@@ -3,8 +3,10 @@ name: L1 contracts CI
33on :
44 pull_request :
55
6+ # We need this permissions for this CI to work with external contributions
67permissions :
78 contents : read
9+ pull-requests : write
810
911jobs :
1012 build :
1921 - name : Install foundry-zksync
2022 run : |
2123 mkdir ./foundry-zksync
22- curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b /foundry_nightly_linux_amd64.tar.gz
24+ curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4 /foundry_nightly_linux_amd64.tar.gz
2325 tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
2426 chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
2527 echo "$PWD/foundry-zksync" >> $GITHUB_PATH
5557 yarn build:foundry
5658
5759 - name : Create cache
58- uses : actions/cache/save@v3
60+ uses : actions/cache/save@v4
5961 with :
6062 key : artifacts-l1-${{ github.sha }}
6163 path : |
@@ -147,7 +149,7 @@ jobs:
147149 - name : Install foundry-zksync
148150 run : |
149151 mkdir ./foundry-zksync
150- curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b /foundry_nightly_linux_amd64.tar.gz
152+ curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4 /foundry_nightly_linux_amd64.tar.gz
151153 tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
152154 chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
153155 echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -171,7 +173,12 @@ jobs:
171173
172174 - name : Run tests
173175 working-directory : ./l1-contracts
174- run : FOUNDRY_PROFILE=default yarn test:foundry
176+ run : yarn test:foundry
177+
178+ # TODO: restore once we can get back to latest foundry
179+ # - name: Check gas snapshots
180+ # working-directory: ./l1-contracts
181+ # run: forge test --match-test MeasureGas --gas-snapshot-check=true
175182
176183 test-foundry-zksync :
177184 needs : [build, lint]
@@ -192,7 +199,7 @@ jobs:
192199 - name : Install foundry-zksync
193200 run : |
194201 mkdir ./foundry-zksync
195- curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b /foundry_nightly_linux_amd64.tar.gz
202+ curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4 /foundry_nightly_linux_amd64.tar.gz
196203 tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
197204 chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
198205 echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -219,7 +226,7 @@ jobs:
219226
220227 - name : Run tests
221228 working-directory : ./l1-contracts
222- run : FOUNDRY_PROFILE=default yarn test:zkfoundry
229+ run : yarn test:zkfoundry
223230
224231 check-verifier-generator-l1 :
225232 runs-on : ubuntu-latest
@@ -278,15 +285,11 @@ jobs:
278285 run : diff tools/data/VerifierFflonk.sol l1-contracts/contracts/state-transition/verifiers/L2VerifierFflonk.sol
279286
280287 coverage :
281- if : false # FIXME: coverage disabled due to stack-too-deep in VerifierFflonk.sol
282288 defaults :
283289 run :
284290 working-directory : l1-contracts
285291 needs : [build, lint]
286292 runs-on : ubuntu-latest
287- permissions :
288- contents : read
289- pull-requests : write
290293
291294 steps :
292295 - name : Checkout the repository
@@ -303,7 +306,7 @@ jobs:
303306 - name : Install foundry-zksync
304307 run : |
305308 mkdir ./foundry-zksync
306- curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-27360d4c8d12beddbb730dae07ad33a206b38f4b /foundry_nightly_linux_amd64.tar.gz
309+ curl -LO https://github.com/matter-labs/foundry-zksync/releases/download/nightly-ae913af65381734ad46c044a9495b67310bc77c4 /foundry_nightly_linux_amd64.tar.gz
307310 tar zxf foundry_nightly_linux_amd64.tar.gz -C ./foundry-zksync
308311 chmod +x ./foundry-zksync/forge ./foundry-zksync/cast
309312 echo "$PWD/foundry-zksync" >> $GITHUB_PATH
@@ -326,7 +329,7 @@ jobs:
326329 system-contracts/zkout
327330
328331 - name : Run coverage
329- run : FOUNDRY_PROFILE=default yarn test:foundry && FOUNDRY_PROFILE=default yarn coverage:foundry --report summary --report lcov
332+ run : yarn test:foundry && yarn coverage:foundry --report summary --report lcov
330333
331334 # Installing the specific version of `lcov` because of
332335 # the `genhtml: ERROR: line ... of ... has branchcov but no linecov data` error.
@@ -337,15 +340,15 @@ jobs:
337340 ref : v1.16
338341
339342 # To ignore coverage for certain directories modify the paths in this step as needed. The
340- # below default ignores coverage results for the test and script directories. Alternatively,
341- # to include coverage in all directories, comment out this step. Note that because this
342- # filtering applies to the lcov file, the summary table generated in the previous step will
343- # still include all files and directories.
344- # The `--rc branch_coverage=1` part keeps branch info in the filtered report, since lcov
345- # defaults to removing branch info.
343+ # below default ignores coverage results for the test and script directories. It also ignores
344+ # the ChainRegistrar contract since it is unused. Alternatively, to include coverage in all
345+ # directories, comment out this step. Note that because this filtering applies to the lcov
346+ # file, the summary table generated in the previous step will still include all files and
347+ # directories. The `--rc branch_coverage=1` part keeps branch info in the filtered report,
348+ # since lcov defaults to removing branch info.
346349 - name : Filter directories
347350 run : |
348- lcov --ignore-errors unused --remove lcov.info 'test/*' 'contracts/dev-contracts/*' 'lib/*' '../lib/*' 'lib/' 'deploy-scripts/*' --output-file lcov.info --rc branch_coverage=1
351+ lcov --ignore-errors unused --remove lcov.info 'test/*' 'contracts/dev-contracts/*' 'lib/*' '../lib/*' 'lib/' 'deploy-scripts/*' 'contracts/chain-registrar/ChainRegistrar.sol' --output-file lcov.info --rc branch_coverage=1
349352
350353 # This step posts a detailed coverage report as a comment and deletes previous comments on
351354 # each push. The below step is used to fail coverage if the specified coverage threshold is
0 commit comments