diff --git a/.codecov.yml b/.codecov.yml index 9455306a4..5bee9146a 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -10,3 +10,6 @@ coverage: project: default: threshold: 1% +ignore: + - "test" + - "contracts/mocks" diff --git a/package.json b/package.json index 2969af0c9..f5ab04837 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/checks/coverage.sh b/scripts/checks/coverage.sh new file mode 100755 index 000000000..12e232354 --- /dev/null +++ b/scripts/checks/coverage.sh @@ -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.