Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Add coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Grund <[email protected]>
  • Loading branch information
jgrund committed May 7, 2024
1 parent 9261318 commit a2013c3
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -26,7 +26,7 @@ jobs:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -39,7 +39,7 @@ jobs:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -54,7 +54,7 @@ jobs:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
Expand All @@ -63,3 +63,29 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --locked -- -D warnings -D clippy::unwrap_used

coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Install `cargo-llvm-cov`
uses: taiki-e/install-action@cargo-llvm-cov

- name: Measure code coverage for all tests
run: |
# Fail if any tests fail
set -e
set -o pipefail
cargo llvm-cov --all-features --workspace --codecov --output-path codecov.json
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: codecov.json
fail_ci_if_error: true

0 comments on commit a2013c3

Please sign in to comment.