Skip to content

Commit 2eaaa65

Browse files
committed
ci: Move lockfile updates to a script
1 parent 9b37157 commit 2eaaa65

2 files changed

Lines changed: 19 additions & 13 deletions

File tree

.github/workflows/dependencies.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,9 @@ jobs:
6262
rustup toolchain install --no-self-update --profile minimal $TOOLCHAIN
6363
rustup default $TOOLCHAIN
6464
65-
- name: cargo update compiler & tools
66-
# Remove first line that always just says "Updating crates.io index"
67-
run: |
68-
echo -e "\ncompiler & tools dependencies:" >> cargo_update.log
69-
cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
70-
- name: cargo update library
71-
run: |
72-
echo -e "\nlibrary dependencies:" >> cargo_update.log
73-
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
74-
- name: cargo update rustbook
75-
run: |
76-
echo -e "\nrustbook dependencies:" >> cargo_update.log
77-
cargo update --manifest-path src/tools/rustbook/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
65+
- name: cargo update
66+
run: ./src/tools/update-lockfile.sh
67+
7868
- name: upload Cargo.lock artifact for use in PR
7969
uses: actions/upload-artifact@v4
8070
with:

src/tools/update-lockfile.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# Updates the workspaces in `.`, `library` and `src/tools/rustbook`
4+
# Logs are written to `cargo_update.log`
5+
# Used as part of regular dependency bumps
6+
7+
echo -e "\ncompiler & tools dependencies:" > cargo_update.log
8+
# Remove first line that always just says "Updating crates.io index"
9+
cargo update 2>&1 | sed '/crates.io index/d' | \
10+
tee -a cargo_update.log
11+
echo -e "\nlibrary dependencies:" >> cargo_update.log
12+
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | \
13+
tee -a cargo_update.log
14+
echo -e "\nrustbook dependencies:" >> cargo_update.log
15+
cargo update --manifest-path src/tools/rustbook/Cargo.toml 2>&1 | sed '/crates.io index/d' | \
16+
tee -a cargo_update.log

0 commit comments

Comments
 (0)