Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
coverage script
  • Loading branch information
cairoeth committed Jun 27, 2024
commit 9dc12c9af92aac26c6b8fec9fd3ccabf3b310930
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"compile": "hardhat compile",
"compile:harnesses": "env SRC=./certora/harnesses hardhat compile",
"coverage": "env COVERAGE=true hardhat coverage && FOUNDRY_FUZZ_RUNS=10 forge coverage --report lcov && lcov -o lcov.info --remove lcov.info 'test/*' 'contracts/mocks/*' && awk '!/,0/' lcov.info > temp && mv temp lcov.info",
"coverage": "scripts/checks/coverage.sh",
"docs": "npm run prepare-docs && oz-docs",
"docs:watch": "oz-docs watch contracts docs/templates docs/config.js",
"prepare": "git config --local core.hooksPath .githooks",
Expand Down
16 changes: 16 additions & 0 deletions scripts/checks/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

export COVERAGE=true
export FOUNDRY_FUZZ_RUNS=10

# Hardhat coverage
npx hardhat coverage

# Foundry coverage
forge coverage --report lcov
# Remove test and mock data
lcov --rc derive_function_end_line=0 -o lcov.info --remove lcov.info 'test/*' 'contracts/mocks/*'
# Remove zero hits
awk '!/,0/' lcov.info > temp && mv temp lcov.info

# Reports are then uploaded to Codecov automatically by workflow, and merged.