Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update coverage target and README #104

Merged
merged 10 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
environment: testing
steps:
- name: Install Rust
uses: dtolnay/[email protected]
Expand All @@ -27,7 +26,6 @@ jobs:
lint:
name: Run Lints
runs-on: ubuntu-latest
environment: testing
steps:
- name: Install Rust
uses: dtolnay/[email protected]
Expand All @@ -49,7 +47,6 @@ jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
environment: testing

env:
HOLESKY_WS_URL: ${{ secrets.HOLESKY_WS_URL }}
Expand Down Expand Up @@ -85,6 +82,9 @@ jobs:
with:
cache-on-failure: true

- name: Install Foundry
run: cargo install --git https://github.com/foundry-rs/foundry --profile release --locked foundry-cast anvil

- name: docker
uses: docker-practice/actions-setup-docker@master

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ coverage:
$(MAKE) start-anvil > /dev/null &
sleep 4 # needed to wait for anvil setup to finish
cargo llvm-cov --lcov --output-path lcov.info --ignore-filename-regex='fireblocks/' --workspace
cargo llvm-cov report --html --ignore-filename-regex='fireblocks/'
docker stop anvil

deps:
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,17 @@ Here's how to generate test coverage reports:

Install llvm tools:
```
rustup component add llvm-tools-preview
make deps
```

Run the tests with coverage instrumentations:
```
cargo clean && mkdir -p coverage/ && rm -r coverage/*
CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='coverage/cargo-test-%p-%m.profraw' cargo test --no-fail-fast
make coverage
```

Install coverage report tool and run it:
Open the coverage html report in a web browser:
```
cargo install grcov
grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/

open target/llvm-cov/html/index.html
```

## Supported Rust Version
Expand Down
Loading