Skip to content

Commit

Permalink
Merge pull request #13 from spacemeshos/code-coverage
Browse files Browse the repository at this point in the history
Enable code coverage
  • Loading branch information
poszu authored Mar 13, 2023
2 parents bc3f3ea + fcc6345 commit 9a4cf8a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# ref: https://docs.codecov.com/docs/codecovyml-reference
coverage:
range: 80..100
round: down
precision: 1
status:
# ref: https://docs.codecov.com/docs/commit-status
project:
default:
# Avoid false negatives
threshold: 1%

ignore:
- "ffi"
- "benches"
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,26 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install stable
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:
fail_ci_if_error: true

build:
name: Build library
runs-on: ${{ matrix.os }}
Expand Down

0 comments on commit 9a4cf8a

Please sign in to comment.