Skip to content

Commit c1cffe9

Browse files
committed
Filter code coverage report results
1 parent 5be7c1c commit c1cffe9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

.github/workflows/code_coverage.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
env:
1010
RUSTFLAGS: "-Cinstrument-coverage"
1111
RUSTDOCFLAGS: "-Cinstrument-coverage"
12-
LLVM_PROFILE_FILE: "report-%p-%m.profraw"
12+
LLVM_PROFILE_FILE: "./target/coverage/%p-%m.profraw"
1313

1414
steps:
1515
- name: Checkout
@@ -38,11 +38,13 @@ jobs:
3838
- name: Install python dependencies
3939
run: pip install hwi==2.1.1 protobuf==3.20.1
4040
- name: Test
41-
run: (cd crates; cargo test --all-features)
41+
run: cargo test --all-features
42+
- name: Make coverage directory
43+
run: mkdir coverage
4244
- name: Run grcov
43-
run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info
45+
run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --keep-only '**/crates/**' --ignore '**/tests/**' --ignore '**/examples/**' -o ./coverage/lcov.info
4446
- name: Generate HTML coverage report
45-
run: genhtml -o coverage-report.html ./coverage/lcov.info
47+
run: genhtml -o coverage-report.html --ignore-errors source ./coverage/lcov.info
4648
- name: Coveralls upload
4749
uses: coverallsapp/github-action@master
4850
with:

0 commit comments

Comments
 (0)