Skip to content

chore: added coverage workflow #11

chore: added coverage workflow

chore: added coverage workflow #11

Workflow file for this run

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