Skip to content

Commit b2a5939

Browse files
committed
switch to new llvm source based coverage
1 parent 5e48acf commit b2a5939

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/coverage.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,26 @@ jobs:
1313
coverage:
1414
name: Coverage
1515
timeout-minutes: 30
16-
runs-on: ubuntu-latest
16+
runs-on: ubuntu-20.04
1717
steps:
1818
- uses: actions/checkout@v2
1919
- uses: actions-rs/toolchain@v1
2020
with:
21-
toolchain: stable
21+
toolchain: nightly
2222
override: true
23-
- name: Skip network tests on Ubuntu
24-
# Ubuntu runners don't have network or DNS configured during test steps
25-
run: echo "ZEBRA_SKIP_NETWORK_TESTS=1" >> $GITHUB_ENV
26-
- name: Run cargo-tarpaulin
27-
uses: actions-rs/[email protected]
28-
with:
29-
version: '0.16.0'
30-
timeout: 600
23+
profile: minimal
24+
components: llvm-tools-preview
25+
- name: Install rustfilt symbol demangler
26+
run: cargo install rustfilt
27+
- name: Rerun tests for coverage
28+
run: cargo test
29+
env:
30+
RUSTFLAGS: -Zinstrument-coverage
31+
LLVM_PROFILE_FILE: "${{ github.workspace }}/test.%p.profraw"
32+
ZEBRA_SKIP_NETWORK_TESTS: 1
33+
- name: Merge coverage data
34+
run: $(rustc --print target-libdir)/../bin/llvm-profdata merge --sparse test.*.profraw -o test.profdata
35+
- name: Generate coverage report
36+
run: $(rustc --print target-libdir)/../bin/llvm-cov export -format=lcov -instr-profile=test.profdata $(find target/debug/deps -type f -perm -u+x ! -name '*.so') > "lcov.info"
3137
- name: Upload coverage report to Codecov
32-
uses: codecov/codecov-action@v1.0.15
38+
uses: codecov/codecov-action@v1

0 commit comments

Comments
 (0)