chore: added coverage workflow #11
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 | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: jdx/mise-action@v2 | |
- run: rustup update stable | |
- run: rustup component add llvm-tools-preview --toolchain stable-x86_64-unknown-linux-gnu | |
- uses: Swatinem/rust-cache@v2 | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Generate code coverage | |
run: | |
source <(cargo llvm-cov show-env --export-prefix) | |
set -euxo pipefail | |
cargo build | |
cargo test --all-features --all-targets | |
cargo llvm-cov report --codecov --output-path codecov.json | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
with: | |
files: codecov.json | |
fail_ci_if_error: true |