Skip to content

Commit ac96adc

Browse files
authored
Merge pull request #89 from rye/ci-source-based-coverage
ci: Enable source-based coverage
2 parents a5f98d7 + 211dc2f commit ac96adc

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

.github/workflows/test.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,28 @@ jobs:
5454
steps:
5555
- name: Install the appropriate Rust toolchain
5656
run: |
57-
rustup toolchain install ${{ matrix.rust }}
57+
rustup toolchain install ${{ matrix.rust }} --component llvm-tools-preview
5858
rustup default ${{ matrix.rust }}
59+
- name: Install grcov
60+
run: cargo install grcov
5961
- uses: actions/checkout@v1
6062
- name: Run tests with profiling
6163
run: |
6264
cargo test --workspace --all-features --no-fail-fast
6365
env:
64-
CARGO_INCREMENTAL: 0
66+
LLVM_PROFILE_FILE: "netaddr2-%p-%m.profraw"
6567
RUSTFLAGS: >
66-
-Zprofile
67-
-Ccodegen-units=1
68-
-Copt-level=0
69-
-Clink-dead-code
70-
-Coverflow-checks=off
71-
-Zpanic_abort_tests
72-
-Cpanic=abort
73-
RUSTDOCFLAGS: '-Cpanic=abort'
74-
- uses: actions-rs/grcov@v0.1
75-
with:
76-
config: .grcov.yml
68+
-Zinstrument-coverage
69+
- name: Run grcov
70+
run: >
71+
grcov .
72+
-s .
73+
--binary-path ./target/debug/
74+
-t lcov
75+
--llvm
76+
--branch
77+
--ignore-not-existing
78+
-o ./lcov.info
7779
- name: Upload coverage
7880
env:
7981
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.grcov.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)