Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ jobs:
- uses: actions/checkout@v4
- name: Set up environment
uses: ./.github/actions/setup
- name: Install LCOV
run: sudo apt-get install lcov
- name: Run coverage
run: npm run coverage
- uses: codecov/codecov-action@v4
Expand Down
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",
"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.