Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: coverage #74

Draft
wants to merge 21 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
args: --all-targets --all-features -- --nocapture
test-coverage:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "whist_browser-%p-%m.profraw"
steps:
- uses: actions/checkout@v3
- name: Install libs
Expand All @@ -49,22 +52,23 @@ jobs:
profile: minimal
toolchain: nightly
override: true
- uses: Swatinem/rust-cache@v1
components: llvm-tools-preview
- uses: actions-rs/cargo@v1
name: Install grcov
with:
command: test
args: --profile coverage --all-targets --all-features --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests'
command: install
args: grcov
- uses: Swatinem/rust-cache@v2
- id: coverage
uses: actions-rs/grcov@v0.1
name: create coverage
run: |
cargo test src
grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
verbose: true
file: ${{ steps.coverage.outputs.report }}
file: ${{ steps.coverage.outputs.lcov.info }}
all-doc-tests:
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
/dist

**/*.rs.bk
/grcov
*.profraw
*.profdata