@@ -169,20 +169,39 @@ jobs:
169
169
runs-on : ubuntu-latest
170
170
steps :
171
171
- uses : actions/checkout@v2
172
+ - uses : actions/cache@v2
173
+ with :
174
+ path : |
175
+ ~/.cargo/registry
176
+ ~/.cargo/git
177
+ target
178
+ key : coverage-cargo-${{ hashFiles('**/Cargo.toml') }}
179
+ - name : install grcov
180
+ run : |
181
+ wget https://github.com/mozilla/grcov/releases/download/v${GRCOV_VERSION}/grcov-linux-x86_64.tar.bz2 -qO- | tar -xjvf -
182
+ mv grcov ~/.cargo/bin
183
+ env :
184
+ GRCOV_VERSION : 0.7.1
172
185
- uses : actions-rs/toolchain@v1
173
186
with :
174
187
toolchain : nightly
175
188
override : true
176
189
profile : minimal
177
- - run : cargo test --no-default-features --no-fail-fast
178
- - run : cargo test --no-default-features --no-fail-fast --features "macros num-bigint num-complex hashbrown serde multiple-pymethods"
179
- -
uses :
actions-rs/[email protected]
180
- id : coverage
190
+ components : llvm-tools-preview
191
+ - run : LLVM_PROFILE_FILE="coverage-%p-%m.profraw" cargo test --no-default-features --no-fail-fast
192
+ - run : LLVM_PROFILE_FILE="coverage-features-%p-%m.profraw" cargo test --no-default-features --no-fail-fast --features "macros num-bigint num-complex hashbrown serde multiple-pymethods"
193
+ # can't yet use actions-rs/grcov with source-based coverage: https://github.com/actions-rs/grcov/issues/105
194
+ # - uses: actions-rs/[email protected]
195
+ # id: coverage
196
+ # - uses: codecov/codecov-action@v1
197
+ # with:
198
+ # file: ${{ steps.coverage.outputs.report }}
199
+ - run : grcov . --binary-path target/debug/deps/ -s . -t lcov --branch --ignore-not-existing -o coverage.lcov
181
200
- uses : codecov/codecov-action@v1
182
201
with :
183
- file : ${{ steps.coverage.outputs.report }}
202
+ file : coverage.lcov
203
+
184
204
env :
185
205
CARGO_TERM_VERBOSE : true
186
- CARGO_INCREMENTAL : 0
187
- RUSTFLAGS : " -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
188
- RUSTDOCFLAGS : " -Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests"
206
+ RUSTFLAGS : " -Zinstrument-coverage"
207
+ RUSTDOCFLAGS : " -Zinstrument-coverage"
0 commit comments