diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 63c87a0b..d0c3745a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,6 +66,6 @@ jobs: - name: "Install cargo-llvm-cov" uses: taiki-e/install-action@cargo-llvm-cov - name: "Generate code coverage for tests" - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + run: bash contrib/coverage.sh - name: "Upload report to coveralls" uses: coverallsapp/github-action@v2 diff --git a/contrib/coverage.sh b/contrib/coverage.sh new file mode 100755 index 00000000..2d453b67 --- /dev/null +++ b/contrib/coverage.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -e + +# https://github.com/taiki-e/cargo-llvm-cov?tab=readme-ov-file#merge-coverages-generated-under-different-test-conditions +cargo llvm-cov clean --workspace # remove artifacts that may affect the coverage results +cargo llvm-cov --no-report --features=send,receive +cargo llvm-cov --no-report --features=v2,danger-local-https,io +cargo llvm-cov report --lcov --output-path lcov.info # generate report without tests diff --git a/contrib/lint.sh b/contrib/lint.sh old mode 100644 new mode 100755