ci: Move lockfile updates to a script

This commit is contained in:
Jamie Hill-Daniel
2026-01-19 04:48:23 +00:00
parent 9b37157ece
commit 0895c4cbe6
2 changed files with 21 additions and 13 deletions

View File

@@ -62,19 +62,9 @@ jobs:
rustup toolchain install --no-self-update --profile minimal $TOOLCHAIN
rustup default $TOOLCHAIN
- name: cargo update compiler & tools
# Remove first line that always just says "Updating crates.io index"
run: |
echo -e "\ncompiler & tools dependencies:" >> cargo_update.log
cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: cargo update library
run: |
echo -e "\nlibrary dependencies:" >> cargo_update.log
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: cargo update rustbook
run: |
echo -e "\nrustbook dependencies:" >> cargo_update.log
cargo update --manifest-path src/tools/rustbook/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: cargo update
run: ./src/tools/update-lockfile.sh
- name: upload Cargo.lock artifact for use in PR
uses: actions/upload-artifact@v4
with:

18
src/tools/update-lockfile.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
# Updates the workspaces in `.`, `library` and `src/tools/rustbook`
# Logs are written to `cargo_update.log`
# Used as part of regular dependency bumps
set -euo pipefail
echo -e "\ncompiler & tools dependencies:" > cargo_update.log
# Remove first line that always just says "Updating crates.io index"
cargo update 2>&1 | sed '/crates.io index/d' | \
tee -a cargo_update.log
echo -e "\nlibrary dependencies:" >> cargo_update.log
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | \
tee -a cargo_update.log
echo -e "\nrustbook dependencies:" >> cargo_update.log
cargo update --manifest-path src/tools/rustbook/Cargo.toml 2>&1 | sed '/crates.io index/d' | \
tee -a cargo_update.log