Skip to content

Commit 19eff78

Browse files
committed
fix: adjust coverage script
1 parent 30753cd commit 19eff78

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.github/scripts/collect-coverage.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@ set -eux -o pipefail
55
export CARGO_INCREMENTAL='0'
66
export RUSTFLAGS='-Cinstrument-coverage'
77

8-
cargo build --verbose --workspace
8+
cargo build --verbose --workspace --tests
99

1010
export LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw'
1111

1212
cargo test --verbose --workspace
1313

1414
mkdir -p ./target/debug/coverage/
1515
grcov . \
16-
-s . \
16+
--source-dir . \
1717
--binary-path ./target/debug/ \
18-
-t lcov,html \
18+
--output-types lcov,html \
1919
--llvm \
2020
--branch \
21+
--keep-only 'crates/**' \
2122
--ignore-not-existing \
2223
--excl-line 'grcov-excl-line|#\[derive\(|ensure!\(|assert!\(|/!|///' \
2324
--excl-start 'grcov-excl-start' \
2425
--excl-stop 'grcov-excl-stop' \
25-
-o ./target/debug/coverage/
26+
--output-path ./target/debug/coverage/

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
uses: actions-rust-lang/setup-rust-toolchain@v1
105105
with:
106106
toolchain: ${{ matrix.rust }}
107-
components: llvm-tools
107+
components: llvm-tools-preview
108108
cache-shared-key: ${{ matrix.os }}-${{ matrix.rust }}
109109

110110
- name: Install grcov
@@ -190,7 +190,6 @@ jobs:
190190
uses: actions-rust-lang/setup-rust-toolchain@v1
191191
with:
192192
toolchain: ${{ matrix.rust }}
193-
components: clippy
194193
cache-shared-key: ${{ matrix.os }}-${{ matrix.rust }}
195194

196195
- name: Fetch cargo dependencies

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@ target/
1313
# MSVC Windows builds of rustc generate these, which store debugging information
1414
*.pdb
1515

16+
# coverage intermediates
17+
*.profraw
18+
1619
# Do not ignore anything inside of `vendor`
1720
!vendor/**

0 commit comments

Comments
 (0)