From 5be7c1c50d3a1e5afdda0756d6c41aa75200861e Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Sat, 29 Apr 2023 09:18:35 -0500 Subject: [PATCH 1/2] Reenable code coverage upload to Coveralls, only for ./crates packages --- .github/workflows/code_coverage.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 37a7cc46..e7d97437 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -38,15 +38,15 @@ jobs: - name: Install python dependencies run: pip install hwi==2.1.1 protobuf==3.20.1 - name: Test - run: cargo test --all-features + run: (cd crates; cargo test --all-features) - name: Run grcov run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info - name: Generate HTML coverage report run: genhtml -o coverage-report.html ./coverage/lcov.info - # - name: Coveralls upload - # uses: coverallsapp/github-action@master - # with: - # github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Coveralls upload + uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.GITHUB_TOKEN }} - name: Upload artifact uses: actions/upload-artifact@v2 with: From c1cffe93338d4c4c0f7e43345c2895ed10e576ea Mon Sep 17 00:00:00 2001 From: Steve Myers Date: Sat, 29 Apr 2023 15:47:08 -0500 Subject: [PATCH 2/2] Filter code coverage report results --- .github/workflows/code_coverage.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index e7d97437..4e1d50c0 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -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: