Skip to content

feat(ci): Initial attempt at adding test coverage to project #1

feat(ci): Initial attempt at adding test coverage to project

feat(ci): Initial attempt at adding test coverage to project #1

Workflow file for this run

name: Code Coverage
on: [push, pull_request]
jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install rust
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin --version 0.26.0
- name: Run tests and generate coverage report
run: cargo tarpaulin --all-features --workspace --out Xml --output-dir ./coverage --ignore-tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage/cobertura.xml
fail_ci_if_error: true