Skip to content

Commit

Permalink
Require Cargo.lock matches Cargo.toml in CI (#153)
Browse files Browse the repository at this point in the history
This passes `--locked` to the first interesting cargo invocation, to
ensure that the `Cargo.lock` file is up to date with `Cargo.toml`.
Without this, if there's been changes to `Cargo.toml` and the user
hasn't run a cargo command locally afterwards, the invocation might
change the `Cargo.lock` file (e.g. bump versions, add packages) and thus
CI runs with an unexpected configuration, that's not recorded in the
repo.

(This came up in pantsbuild/scie-pants#290 and I
thought to check other Rust repos that are tangentially related.)
  • Loading branch information
huonw committed Sep 27, 2023
1 parent 85a3162 commit 41c81d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
rustup toolchain add nightly -c rustfmt
cargo +nightly fmt --check --all
- name: Lint
run: cargo clippy --all
run: cargo clippy --locked --all
- name: Unit Tests
run: cargo test --all
- name: Build & Package
Expand Down

0 comments on commit 41c81d6

Please sign in to comment.