name: Coverage (llvm-cov → Codecov)
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust (stable)
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
workspaces: . -> target
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov --locked
- name: Generate coverage (LCOV)
run: cargo llvm-cov --all-features --lcov --output-path lcov.info --fail-under-lines 60
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
files: ./lcov.info
flags: unittests
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}