Skip to content

Commit

Permalink
Update actions to pin Rust nightly version (#318)
Browse files Browse the repository at this point in the history
Fix attempt for inconsistent Github Actions failures.
  • Loading branch information
cycraig authored Jul 16, 2021
1 parent f35074d commit 3a1d3d3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/scripts/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand All @@ -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..."
Expand All @@ -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 - \
); \
Expand All @@ -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 \
Expand Down

0 comments on commit 3a1d3d3

Please sign in to comment.