-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Determine code coverage | ||
'on': | ||
workflow_call: null | ||
jobs: | ||
cov: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Test with profiling data | ||
run: cargo test | ||
env: | ||
CARGO_INCREMENTAL: 0 | ||
LLVM_PROFILE_FILE: 'cargo-test-%p-%m.profraw' | ||
RUSTFLAGS: '-Cinstrument-coverage' | ||
|
||
- name: Install grcov fast | ||
uses: SierraSoftworks/setup-grcov@v1 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
version: latest | ||
|
||
- name: Add llvm-tools-preview | ||
run: rustup component add llvm-tools-preview | ||
|
||
- name: Create lcov output dir | ||
run: | | ||
mkdir target/coverage | ||
- name: Generate lcov from profiling data | ||
run: grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '**/generated/**/*' --ignore '**/integration/**/*' --ignore '**/tests/**/*' --ignore '../*' --ignore "/*" -o target/coverage/tests.lcov | ||
|
||
- name: Upload lcov to codecov.io | ||
uses: codecov/codecov-action@v4 | ||
with: | ||
files: target/coverage/*.lcov | ||
|
||
- name: Wipe stray profiling files | ||
run: find . -type f -name "*.profraw" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters