Commit 8eb0b4b9 authored by Matt Solomon's avatar Matt Solomon Committed by GitHub

ci(ctb): check contract size limits and isolate deny warnings (#10222)

* ci(ctb): check contract size limits and isolate deny warnings

* ci: fix size check
parent f9c61344
......@@ -506,6 +506,16 @@ jobs:
command: |
pnpm lint:check || echo "export LINT_STATUS=1" >> "$BASH_ENV"
working_directory: packages/contracts-bedrock
- run:
# The solc warnings check must be the first step to build the contracts, that way the
# warnings are output here. On subsequent runs, forge will read artifacts from the cache
# so warnings would not occur.
name: solc warnings check
command: |
forge build --deny-warnings || echo "export SOLC_WARNINGS_CHECK=1" >> "$BASH_ENV"
environment:
FOUNDRY_PROFILE: ci
working_directory: packages/contracts-bedrock
- run:
name: gas snapshot
command: |
......@@ -525,6 +535,13 @@ jobs:
command: |
pnpm snapshots:check || echo "export SNAPSHOTS_STATUS=1" >> "$BASH_ENV"
working_directory: packages/contracts-bedrock
- run:
name: size check
command: |
forge build --sizes --skip "/**/test/**" --skip "/**/scripts/**" || echo "export SIZE_CHECK=1" >> "$BASH_ENV"
environment:
FOUNDRY_PROFILE: ci
working_directory: packages/contracts-bedrock
- run:
name: check statuses
command: |
......@@ -532,6 +549,10 @@ jobs:
echo "Linting failed, see job output for details."
FAILED=1
fi
if [[ "$SOLC_WARNINGS_CHECK" -ne 0 ]]; then
echo "Solidity emitted warnings, see job output for details."
FAILED=1
fi
if [[ "$GAS_SNAPSHOT_STATUS" -ne 0 ]]; then
echo "Gas snapshot failed, see job output for details."
FAILED=1
......@@ -552,6 +573,10 @@ jobs:
echo "Snapshots check failed, see job output for details."
FAILED=1
fi
if [[ "$SIZE_CHECK" -ne 0 ]]; then
echo "Contract(s) exceed size limit, see job output for details."
FAILED=1
fi
if [[ "$FAILED" -ne 0 ]]; then
exit 1
fi
......
......@@ -57,7 +57,6 @@ ignore = ['src/vendor/WETH9.sol']
################################################################
[profile.ci]
deny_warnings = true
fuzz = { runs = 512 }
[profile.ci.invariant]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment