From 3a1d3d35fe4833832fd3b256ba0b29a1596dc78b Mon Sep 17 00:00:00 2001 From: Craig Bester Date: Fri, 16 Jul 2021 12:52:57 +0200 Subject: [PATCH] Update actions to pin Rust nightly version (#318) Fix attempt for inconsistent Github Actions failures. --- .github/workflows/coverage.yml | 2 +- .github/workflows/format.yml | 2 +- .github/workflows/scripts/coverage.sh | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index d071ddde75..ef27bcf626 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -25,7 +25,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: nightly-2021-07-05 override: true components: llvm-tools-preview - uses: actions-rs/install@v0.1 diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 2d9bd6ba16..9e491a7086 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -26,7 +26,7 @@ jobs: uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: nightly + toolchain: nightly-2021-07-05 override: true components: rustfmt - name: core fmt check diff --git a/.github/workflows/scripts/coverage.sh b/.github/workflows/scripts/coverage.sh index 2671ca17ee..41675dd57c 100755 --- a/.github/workflows/scripts/coverage.sh +++ b/.github/workflows/scripts/coverage.sh @@ -5,9 +5,11 @@ set -e rm -rf coverage mkdir coverage +NIGHTLY="+nightly-2021-07-05" + # Run tests with profiling instrumentation echo "Running instrumented unit tests..." -RUSTFLAGS="-Zinstrument-coverage" LLVM_PROFILE_FILE="identity-%m.profraw" cargo +nightly test --tests --all --all-features +RUSTFLAGS="-Zinstrument-coverage" LLVM_PROFILE_FILE="identity-%m.profraw" cargo $NIGHTLY test --tests --all --all-features # Merge all .profraw files into "identity.profdata" echo "Merging coverage data..." @@ -18,7 +20,7 @@ do PROFRAW="${PROFRAW} $file" done -cargo +nightly profdata -- merge ${PROFRAW} -o identity.profdata +cargo $NIGHTLY profdata -- merge ${PROFRAW} -o identity.profdata # List the test binaries echo "Locating test binaries..." @@ -27,7 +29,7 @@ BINARIES="" for file in \ $( \ RUSTFLAGS="-Zinstrument-coverage" \ - cargo +nightly test --tests --all --all-features --no-run --message-format=json \ + cargo $NIGHTLY test --tests --all --all-features --no-run --message-format=json \ | jq -r "select(.profile.test == true) | .filenames[]" \ | grep -v dSYM - \ ); \ @@ -38,7 +40,7 @@ done # Generate and export the coverage report to lcov format echo "Generating lcov file..." -cargo +nightly cov -- export ${BINARIES} \ +cargo $NIGHTLY cov -- export ${BINARIES} \ --instr-profile=identity.profdata \ --ignore-filename-regex="/.cargo|rustc|target|tests|/.rustup" \ --format=lcov --Xdemangler=rustfilt \