ci: add codecov coverage report #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Coverage check | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: {} | |
jobs: | |
run: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
matrix: | |
os: [ubuntu] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mozilla-actions/[email protected] | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: llvm-tools-preview | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Run tests with coverage instrumentation | |
run: | | |
cargo llvm-cov clean --workspace | |
cargo llvm-cov --doctests | |
- name: Generate coverage report | |
run: cargo llvm-cov report --codecov --output-path coverage.json | |
- uses: codecov/codecov-action@v3 | |
with: | |
file: coverage.json | |
name: ${{ matrix.os }} |