Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add code coverage #807

Merged
merged 3 commits into from
Jan 12, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add code coverage
andrewgazelka committed Jan 12, 2025
commit cd12b782cc4743d4e0e87718fc9f140a482ca0fa
35 changes: 35 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
coverage:
status:
project:
default:
# basic
target: auto
threshold: 1%
base: auto
# advanced
branches:
- main
if_ci_failed: error
informational: false
only_pulls: false

patch:
default:
# basic
target: auto
threshold: 1%
base: auto
# advanced
branches:
- main
if_ci_failed: error
informational: false
only_pulls: false

ignore:
- "**/benches/**/*" # Ignore benchmarks
- "**/*_test.rs" # Ignore test files
- "**/tests/**/*" # Ignore test directories

github_checks:
annotations: true
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -62,6 +62,28 @@ jobs:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --all-features

coverage:
name: Code Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: llvm-tools-preview
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: "true"
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --branch --lcov --output-path lcov.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true

test:
name: Tests (${{ matrix.os }})
strategy:
Loading