Skip to content

Commit

Permalink
chore(ci): Add --locked flag to cargo install step (#3129)
Browse files Browse the repository at this point in the history
This PR tweaks the installation of `cargo-semver-checks` to make it use the `--locked` flag.

Installing binaries with their locked dependency versions makes it less likely that you might run into issues caused by bugs in dependency libraries, since your installed dependency versions match the versions used in the binary's own test environment.

This is a recommendation that applies to most Rust binary tools. For example, here's cargo-nextest recommending the same: https://nexte.st/book/installing-from-source.html#installing-from-cratesio
  • Loading branch information
obi1kenobi authored Nov 20, 2022
1 parent 8678dc7 commit 9b18277
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: Check public API for semver violations
if: steps.check-released.outputs.code == 200 # Workaround until https://github.com/obi1kenobi/cargo-semver-check/issues/146 is shipped.
run: |
cargo install cargo-semver-checks
cargo install cargo-semver-checks --locked
cargo semver-checks check-release -p ${{ matrix.crate }}
cross:
Expand Down Expand Up @@ -231,12 +231,12 @@ jobs:
run: |
ALL_FEATURES=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features | keys | map(select(. != "full")) | sort | join(" ")')
FULL_FEATURE=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "libp2p") | .features["full"] | sort | join(" ")')
test "$ALL_FEATURES = $FULL_FEATURE"
echo "$ALL_FEATURES";
echo "$FULL_FEATURE";
test "$ALL_FEATURES" = "$FULL_FEATURE"
gather_published_crates:
Expand Down

0 comments on commit 9b18277

Please sign in to comment.