name: 🧪 Test Coverage
on:
push:
branches: [ master ]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.gitignore'
- '.ignore'
- '.github/dependabot.yml'
pull_request:
branches: [ master ]
paths-ignore:
- '**/*.md'
- 'LICENSE'
- '.gitignore'
- '.ignore'
- '.github/dependabot.yml'
jobs:
coverage:
name: 🔢 Test Coverage on ${{ matrix.os }} (Rust ${{ matrix.rust }})
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.rust == 'nightly' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, ubuntu-22.04, ubuntu-24.04-arm, ubuntu-22.04-arm, macos-latest, windows-latest, windows-2022, windows-11-arm]
rust: [stable, beta, nightly, '1.70']
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: llvm-tools-preview
- name: Cache cargo registry and build artifacts
uses: Swatinem/rust-cache@v2
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov
if: ${{ matrix.os != 'windows-11-arm' && matrix.rust != '1.70' }}
- name: Run tests with coverage
if: ${{ matrix.os != 'windows-11-arm' && matrix.rust != '1.70' }}
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
- name: Run tests (no coverage on windows-11-arm)
if: ${{ matrix.os == 'windows-11-arm' && matrix.rust != '1.70' }}
run: cargo test --all-features
- name: MSRV build check
if: ${{ matrix.rust == '1.70' }}
run: cargo build --all-features --verbose
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
if: ${{ matrix.os == 'ubuntu-latest' && matrix.rust == 'stable' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./lcov.info
flags: unittests
name: codecov-umbrella