Add Foundry tests to coverage (#5098)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
This commit is contained in:
@ -10,3 +10,6 @@ coverage:
|
|||||||
project:
|
project:
|
||||||
default:
|
default:
|
||||||
threshold: 1%
|
threshold: 1%
|
||||||
|
ignore:
|
||||||
|
- "test"
|
||||||
|
- "contracts/mocks"
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "hardhat compile",
|
"compile": "hardhat compile",
|
||||||
"compile:harnesses": "env SRC=./certora/harnesses 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": "npm run prepare-docs && oz-docs",
|
||||||
"docs:watch": "oz-docs watch contracts docs/templates docs/config.js",
|
"docs:watch": "oz-docs watch contracts docs/templates docs/config.js",
|
||||||
"prepare": "git config --local core.hooksPath .githooks",
|
"prepare": "git config --local core.hooksPath .githooks",
|
||||||
|
|||||||
18
scripts/checks/coverage.sh
Executable file
18
scripts/checks/coverage.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
export COVERAGE=true
|
||||||
|
export FOUNDRY_FUZZ_RUNS=10
|
||||||
|
|
||||||
|
# Hardhat coverage
|
||||||
|
hardhat coverage
|
||||||
|
|
||||||
|
if [ "${CI:-"false"}" == "true" ]; then
|
||||||
|
# Foundry coverage
|
||||||
|
forge coverage --report lcov
|
||||||
|
# Remove zero hits
|
||||||
|
sed -i '/,0/d' lcov.info
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Reports are then uploaded to Codecov automatically by workflow, and merged.
|
||||||
Reference in New Issue
Block a user