Ensure the Cargo.lock file is up-to-date in pull request CI

This commit is contained in:
Zanie Blue
2026-05-08 10:08:23 -07:00
parent 5b87bd2845
commit 03fbadbce7
4 changed files with 11 additions and 2 deletions
+2
View File
@@ -21,6 +21,8 @@ jobs:
- uses: dtolnay/rust-toolchain@a0b273b48ed29de4470960879e8381ff45632f26 # 1.93.0
with:
components: rustfmt
- name: Check Cargo.lock is up to date
run: cargo metadata --locked --format-version 1 >/dev/null
- name: cargo fmt
run: cargo fmt -- --config imports_granularity=Item --check
+2
View File
@@ -65,6 +65,8 @@ jobs:
- uses: dtolnay/rust-toolchain@a0b273b48ed29de4470960879e8381ff45632f26 # 1.93.0
with:
components: rustfmt
- name: Check Cargo.lock is up to date
run: cargo metadata --locked --format-version 1 >/dev/null
- name: cargo fmt
run: cargo fmt -- --config imports_granularity=Item --check
+2 -2
View File
@@ -32,10 +32,10 @@ just bazel-lock-update
This runs `bazel mod deps --lockfile_mode=update` and updates `MODULE.bazel.lock` if needed.
Commit the lockfile changes along with your Cargo lockfile update.
To verify lockfile alignment locally (the same check CI runs), use:
To verify lockfile alignment locally (the same checks CI runs), use:
```bash
just bazel-lock-check
just lock-check
```
In some cases, an upstream crate may need a patch or a `crate.annotation` in `../MODULE.bzl`
+5
View File
@@ -44,6 +44,11 @@ install:
rustup show active-toolchain
cargo fetch
cargo-lock-check:
cargo metadata --locked --format-version 1 >/dev/null
lock-check: cargo-lock-check bazel-lock-check
# Run `cargo nextest` since it's faster than `cargo test`, though including
# --no-fail-fast is important to ensure all tests are run.
#