From 9b182778e119200ee3f1e623f92149ef63d677ae Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> Date: Sun, 20 Nov 2022 16:48:24 -0500 Subject: [PATCH] chore(ci): Add `--locked` flag to `cargo install` step (#3129) 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 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f74e05585e2..15a44fcb526 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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: