name: Coverage
on:
push:
branches: [main, master, feature/**]
pull_request:
branches: [main, master]
env:
CARGO_TERM_COLOR: always
jobs:
coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Setup Rust cache
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
fail_ci_if_error: false
verbose: true
continue-on-error: true
- name: Note if token missing
if: secrets.CODECOV_TOKEN == ''
run: |
echo "::notice::CODECOV_TOKEN not configured - coverage upload skipped"
echo "To enable coverage upload, add CODECOV_TOKEN to repository secrets"