Skip to content

Commit

Permalink
Grcov
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Jul 16, 2024
1 parent 6a7c637 commit c120ba4
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,24 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Install cargo-tarpaulin
run: cargo binstall cargo-tarpaulin
- name: Prepare for coverage
if: matrix.os == 'ubuntu-latest'
run: |
cargo binstall grcov
echo "RUSTFLAGS=-Cinstrument-coverage" >> "$GITHUB_ENV"
echo "LLVM_PROFILE_FILE=$(pwd)/target/chia_rs-%p-%m.profraw" >> "$GITHUB_ENV"
echo "CARGO_TARGET_DIR=$(pwd)/target" >> "$GITHUB_ENV"
- name: Run tests
run: cargo test --workspace --all-features --release

- name: Tests
run: cargo tarpaulin --workspace --all-features --release --out lcov
- name: Continue with coverage
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install lcov -y
rustup component add llvm-tools-preview
grcov . --binary-path target -s . --branch --ignore-not-existing --ignore='*/.cargo/*' --ignore='tests/*' --ignore='venv/*' -o rust_cov.info
python -c 'with open("rust_cov.info") as f: lines = [l for l in f if not (l.startswith("DA:") and int(l.split(",")[1].strip()) >= 2**63)]; open("lcov.info", "w").writelines(lines)'
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
Expand Down

0 comments on commit c120ba4

Please sign in to comment.