]> Untitled Git - bdk/commitdiff
Filter code coverage report results
authorSteve Myers <steve@notmandatory.org>
Sat, 29 Apr 2023 20:47:08 +0000 (15:47 -0500)
committerSteve Myers <steve@notmandatory.org>
Sat, 29 Apr 2023 20:47:08 +0000 (15:47 -0500)
.github/workflows/code_coverage.yml

index e7d97437380abf881a0d7d6ecaeff85212561ddf..4e1d50c03a5ef327c1c82baf84b42392554ca6c1 100644 (file)
@@ -9,7 +9,7 @@ jobs:
     env:
       RUSTFLAGS: "-Cinstrument-coverage"
       RUSTDOCFLAGS: "-Cinstrument-coverage"
-      LLVM_PROFILE_FILE: "report-%p-%m.profraw"
+      LLVM_PROFILE_FILE: "./target/coverage/%p-%m.profraw"
 
     steps:
       - name: Checkout
@@ -38,11 +38,13 @@ jobs:
       - name: Install python dependencies
         run: pip install hwi==2.1.1 protobuf==3.20.1
       - name: Test
-        run: (cd crates; cargo test --all-features)
+        run: cargo test --all-features
+      - name: Make coverage directory
+        run: mkdir coverage
       - name: Run grcov
-        run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info
+        run: grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --keep-only '**/crates/**' --ignore '**/tests/**' --ignore '**/examples/**' -o ./coverage/lcov.info
       - name: Generate HTML coverage report
-        run: genhtml -o coverage-report.html ./coverage/lcov.info
+        run: genhtml -o coverage-report.html --ignore-errors source ./coverage/lcov.info
       - name: Coveralls upload
         uses: coverallsapp/github-action@master
         with: