Skip to content

Commit 822fa14

Browse files
ci(rust-ci-reusable): pass --locked to cargo check/clippy/test (closes #295) (#299)
## Summary Adds `--locked` to all three cargo invocations in `rust-ci-reusable.yml` (`check`, `clippy`, `test`). The reusable is consumed estate-wide via thin wrappers; this change fans out automatically. ## Why `hyperpolymath/echidna` had five dependabot major-version bumps merge 2026-05-29 (axum 0.7→0.8, rand 0.9→0.10, criterion 0.5→0.8, nom 7→8, rustyline 15→18) without paired code updates. Locally `cargo check --locked` failed with "cannot update the lock file because --locked was passed", proving the workspace needed something the lockfile couldn't satisfy. CI lacked `--locked`, silently re-resolved to the newer transitives, and broke compile on every push for ~24h until echidna#128 reverted. ## Effect The next dependabot major bump that breaks compile fails at PR time — where it's cheap to revert/fix — instead of merging green and breaking everyone downstream. ## Caller-side considerations - Repos that ship intentionally-stale lockfiles will see new CI failures. Those repos should run `cargo update` and commit the fresh lock; this is the correct "sync your lockfile to Cargo.toml" signal. - Repos that don't ship `Cargo.lock` (libraries with no application root) won't be affected — `--locked` is a no-op when there's nothing to lock. ## Test plan - [ ] CI: this PR's own rust-ci passes with the new `--locked` constraint. - [ ] After merge: monitor downstream rust-ci wrappers for first-time `--locked` failures (those are the repos that need their lockfile synced). Closes #295.
1 parent fef9a0b commit 822fa14

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.github/workflows/rust-ci-reusable.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,17 @@ jobs:
130130
workspaces: ${{ inputs.working_directory }}
131131

132132
- name: Cargo check
133-
run: cargo check ${{ inputs.check_args }}
133+
# `--locked` so CI honours `Cargo.lock` and surfaces dep drift the
134+
# first push it happens, instead of silently re-resolving (which
135+
# masked the echidna#92 / echidna PR #128 dependabot major-bump
136+
# break for 24h). See standards#295.
137+
run: cargo check --locked ${{ inputs.check_args }}
134138

135139
- name: Cargo fmt
136140
run: cargo fmt --all -- --check
137141

138142
- name: Cargo clippy
139-
run: cargo clippy ${{ inputs.clippy_args }}
143+
run: cargo clippy --locked ${{ inputs.clippy_args }}
140144

141145
test:
142146
name: Cargo test
@@ -164,7 +168,8 @@ jobs:
164168
workspaces: ${{ inputs.working_directory }}
165169

166170
- name: Run tests
167-
run: cargo test ${{ inputs.test_args }}
171+
# `--locked` — see Cargo check above.
172+
run: cargo test --locked ${{ inputs.test_args }}
168173

169174
- name: Write summary
170175
if: always()

0 commit comments

Comments
 (0)