Go back to tarpaulin-based coverage

This commit is contained in:
Deirdre Connolly 2021-06-11 17:24:10 -04:00
parent 09333f6407
commit 4769fbe900
1 changed files with 7 additions and 43 deletions

View File

@ -56,54 +56,18 @@ jobs:
args: --all-features --all-targets -- -D warnings args: --all-features --all-targets -- -D warnings
coverage: coverage:
name: Coverage (+nightly) name: Code Coverage
# The large timeout is to accommodate nightly builds
timeout-minutes: 45
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2.3.4 - uses: actions/checkout@v2.3.4
- uses: actions-rs/toolchain@v1.0.7
with: with:
persist-credentials: false toolchain: stable
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true override: true
profile: minimal - name: Run cargo-tarpaulin
components: llvm-tools-preview uses: actions-rs/tarpaulin@v0.1.3
- name: Install rustfilt symbol demangler
run: |
cargo install rustfilt
- name: Rerun tests for coverage
env:
RUSTFLAGS: -Zinstrument-coverage -C link-dead-code -C debuginfo=2
LLVM_PROFILE_FILE: "${{ github.workspace }}/test.%p.profraw"
ZEBRA_SKIP_NETWORK_TESTS: 1
CARGO_INCREMENTAL: 0
run: |
cargo test --all-features
cargo test --all-features --no-run --message-format=json | jq -r "select(.profile.test == true) | .filenames[]" | grep -v dSYM - > filenames.txt
- name: Merge coverage data
run: |
$(rustc --print target-libdir)/../bin/llvm-profdata merge test.*.profraw -o test.profdata
- name: Generate detailed html coverage report for github artifact
run: |
$(rustc --print target-libdir)/../bin/llvm-cov show -format=html -ignore-filename-regex=".*/.cargo/registry/.*" -ignore-filename-regex=".*/.cargo/git/.*" -ignore-filename-regex=".*/.rustup/.*" -Xdemangler=rustfilt -show-instantiations -output-dir=./coverage -instr-profile=./test.profdata $(printf -- "-object %s " $(cat filenames.txt))
- name: Generate json coverage report for codecov
run: |
$(rustc --print target-libdir)/../bin/llvm-cov export -format=text -instr-profile=test.profdata $(printf -- "-object %s " $(cat filenames.txt)) > "lcov.info"
- uses: actions/upload-artifact@v2
with: with:
name: coverage version: '0.18.0-alpha3'
path: | timeout: 300
./coverage
./lcov.info
- name: Upload coverage report to Codecov - name: Upload coverage report to Codecov
uses: codecov/codecov-action@v1.5.2 uses: codecov/codecov-action@v1.5.2