Skip to content

Commit

Permalink
Merge pull request #120 from ideal-lab5/cki/code-coverage
Browse files Browse the repository at this point in the history
Cki/code coverage
  • Loading branch information
juangirini authored Feb 25, 2025
2 parents c6f0685 + cf0a6b0 commit 2a9a01a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -48,5 +48,21 @@ jobs:
- name: Run cargo clippy
run: cargo clippy -- -D warnings

- name: Run cargo test
run: cargo test --verbose --no-fail-fast
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin

- name: Run cargo tarpaulin
run: cargo tarpaulin --rustflags="-C opt-level=0" --no-fail-fast --out xml

- name: Generate Code Coverage Summary
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: cobertura.xml
badge: true
fail_below_min: true
thresholds: '50 85'
output: both
format: markdown

- name: Export Job Summary
run: echo "$(<code-coverage-results.md)" >> $GITHUB_STEP_SUMMARY
5 changes: 5 additions & 0 deletions tarpaulin.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# https://github.com/xd009642/tarpaulin/blob/develop/tarpaulin.toml
[test_config]

# List of file paths to exclude from testing.
exclude-files = ["solochain/*", "pallets/drand/examples/solochain/*"]

0 comments on commit 2a9a01a

Please sign in to comment.