Skip to content

fix grcov run

fix grcov run #2

Workflow file for this run

name: Coverage
on:
push:
branches:
- master
- coverage
pull_request:
branches:
- master
jobs:
codecov:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: llvm-tools-preview
- name: Run tests
env:
RUSTFLAGS: "-Cinstrument-coverage"
RUSTDOCFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "target/coverage/%p-%m.profraw"
run: cargo test
- name: Install grcov
run: cargo install grcov
- name: Generate coverage report
run: >
grcov target/coverage -s . --binary-path target/debug/ -t lcov --branch
--ignore 'target/*' --ignore 'tests/*' --ignore-not-existing -o coverage.lcov
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
file: coverage.lcov
flags: rust
token: ${{ secrets.CODECOV_TOKEN }}