Skip to content

add coverage GH actions workflow #1

add coverage GH actions workflow

add coverage GH actions workflow #1

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"
run: cargo test
- name: Install grcov
run: cargo install grcov
- name: Generate coverage report
run: >
grcov . -s . --binary-path target/debug/ -t lcov --branch
--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 }}