Skip to content

Commit 3fe67ce

Browse files
committed
codecov: keep only crates/ and do not include crates registry
This avoids collisions between paths, we were seeing odd issues around some files having a different tracked amount in codecov vs lcov. It appears to be due to having coverage results from cxx_gen with the same file paths. We do not want coverage data for anything else anyway so filter them out.
1 parent 3d90f15 commit 3fe67ce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/github-cxx-qt-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
LLVM_PROFILE_FILE: coverage/coverage_data-%p-%m.profraw
101101
run: cargo test --lib --package cxx-qt-gen
102102
- name: generate-report
103-
run: grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing --llvm --llvm-path /usr/lib/llvm-17/bin/ -o ./target/debug/lcov.info --excl-start CODECOV_EXCLUDE_START --excl-stop CODECOV_EXCLUDE_STOP
103+
run: grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing --llvm --llvm-path /usr/lib/llvm-17/bin/ --keep-only 'crates/*' -o ./target/debug/lcov.info --excl-start CODECOV_EXCLUDE_START --excl-stop CODECOV_EXCLUDE_STOP
104104
- name: upload-report
105105
uses: codecov/codecov-action@v5
106106
with:

scripts/grcov_cxx_qt.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ export RUSTFLAGS="-Cinstrument-coverage"
3232
export LLVM_PROFILE_FILE="$SCRIPTPATH/coverage/coverage_data-%p-%m.profraw"
3333
cargo build --package cxx-qt-gen
3434
cargo test --package cxx-qt-gen
35-
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing --llvm --llvm-path=/usr/lib/llvm-17/bin/ -o ./target/debug/ --excl-start CODECOV_EXCLUDE_START --excl-stop CODECOV_EXCLUDE_STOP
35+
grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing --llvm --llvm-path=/usr/lib/llvm-17/bin/ --keep-only 'crates/*' -o ./target/debug/ --excl-start CODECOV_EXCLUDE_START --excl-stop CODECOV_EXCLUDE_STOP
3636
echo "Coverage html report generated in $(realpath "$SCRIPTPATH"/../target/debug/html)"

0 commit comments

Comments
 (0)