Skip to content

Commit

Permalink
Add code coverage job (#8)
Browse files Browse the repository at this point in the history
* Add code coverage job

* Use cargo-llvm-cov

* Add coverage report file

* Clean up

* Clean up
  • Loading branch information
quambene authored Aug 29, 2023
1 parent b8256d2 commit 78eec48
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
check:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -41,3 +42,22 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- name: cargo test
run: cargo test
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov
run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78eec48

Please sign in to comment.