Skip to content

Commit

Permalink
Source-based coverage (#840)
Browse files Browse the repository at this point in the history
* Run grcov and codecov manually in CI

* Bump nightly to latest

* Run cargo test manually

* Run cargo test manually

* Run cargo test manually

* Use grcov 0.6.1

* Prevent *.profraw overwrites

* Add a 30-minute timeout to kvstore-integration-latest CI job

* Pin nightly version

* Back to cargo test through github action

* Parse branch coverage info
  • Loading branch information
vitorenesduarte authored Mar 31, 2021
1 parent e4eb6b9 commit 4a6c450
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
6 changes: 0 additions & 6 deletions .github/actions-rs/grcov.yml

This file was deleted.

28 changes: 14 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,22 @@ jobs:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
toolchain: nightly-2021-03-25
override: true
- uses: actions-rs/cargo@v1
with:
command: clean
- uses: actions-rs/cargo@v1
with:
command: test-all-features
env:
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=unwind -Zpanic_abort_tests"
- uses: actions-rs/[email protected]
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ steps.coverage.outputs.report }}
yml: ./codecov.yml
fail_ci_if_error: true
RUSTFLAGS: '-Zinstrument-coverage'
LLVM_PROFILE_FILE: '%m.profraw'
- name: Install grcov
run: |
rustup component add llvm-tools-preview
curl -L https://github.com/mozilla/grcov/releases/download/v0.6.1/grcov-linux-x86_64.tar.bz2 | tar jxf -
- name: Run grcov
run: |
./grcov . --source-dir . --binary-path ./target/debug/ --output-type lcov --output-path ./lcov.info --branch --ignore-not-existing
- name: Upload to Codecov
run: |
bash <(curl -s https://codecov.io/bash) -f ./lcov.info

0 comments on commit 4a6c450

Please sign in to comment.