55 pull_request :
66 workflow_dispatch :
77
8- env :
9- FOUNDRY_PROFILE : ci
10-
118jobs :
129 check :
1310 strategy :
1411 fail-fast : true
12+ matrix :
13+ foundry_profile : ["test-via-ir", "test-no-ir"]
1514
1615 name : Foundry project
1716 runs-on : ubuntu-latest
17+ env :
18+ FOUNDRY_PROFILE : ${{ matrix.foundry_profile }}
1819 steps :
1920 - uses : actions/checkout@v4
2021 with :
@@ -39,23 +40,30 @@ jobs:
3940 forge build --sizes
4041 id : build
4142
43+ # This `forge snapshot` command is only used for CBORDecoder comparison.
44+ # https://book.getfoundry.sh/forge/gas-section-snapshots
4245 - name : Confirm comparison snapshot
4346 run : |
44- forge snapshot --match-path "test/comparison/*" --check
47+ forge snapshot --check ${{ env.FOUNDRY_PROFILE }}.gas-snapshot \
48+ --match-path "test/comparison/*"
4549 id : comparison-snapshot
4650
47- - name : Run all Forge tests
51+ - name : Run remaining Forge tests, confirm section snapshots
4852 run : |
49- forge test -vvv
53+ forge test -vvv \
54+ --no-match-path "test/comparison/*"
55+ git diff --exit-code snapshots-${{ env.FOUNDRY_PROFILE }}
5056 id : test
5157
52- - name : Confirm section snapshots
53- run : |
54- git diff --exit-code snapshots
55- id : diff-section-snapshots
5658
59+ # Coverage testing affects gas cost, and creates different snapshots.
60+ # Only `lcov.info` is diffed to confirm coverage is checked in. Coverage
61+ # doesn't use the 'comparison' tests.
5762 - name : Confirm coverage
5863 run : |
59- forge coverage --report lcov
60- git diff --exit-code lcov.info
61- id : diff-coverage
64+ forge coverage --report-file ${{ env.FOUNDRY_PROFILE }}.lcov.info \
65+ --report lcov --report summary \
66+ --no-match-path "test/comparison/*" \
67+ --no-match-coverage "test/comparison/*"
68+ git diff --exit-code ${{ env.FOUNDRY_PROFILE }}.lcov.info
69+ id : diff-coverage
0 commit comments