name: Codecov
permissions:
contents: read
pull-requests: write
on:
push:
branches:
- main
paths:
- "**/*.rs"
- "**/*.json"
- "**/*.lock"
- "**/*.toml"
pull_request:
paths:
- "**/*.rs"
- "**/*.json"
- "**/*.lock"
- "**/*.toml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
coverage:
name: Codecov Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
prefix-key: "v1-coverage"
- uses: taiki-e/install-action@v2
with:
tool: cargo-llvm-cov,nextest
- name: Run tests with coverage
run: cargo llvm-cov nextest --profile ci --all-features --lcov --output-path lcov.info
- name: Upload coverage to codecov.io
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: lcov.info
disable_search: true