@@ -6,6 +6,9 @@ concurrency:
66 group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
77 cancel-in-progress : true
88
9+ env :
10+ FOUNDRY_PROFILE : ci
11+
912# Set default permissions as restrictive as possible
1013permissions :
1114 actions : write # Required for upload-artifact
@@ -27,14 +30,12 @@ jobs:
2730 cache : ' npm'
2831 cache-dependency-path : ' **/package-lock.json'
2932
30- # Only cache node_modules, let setup-node handle npm cache
3133 - name : Cache node_modules
3234 uses : actions/cache@v4
3335 id : cache-node-modules
3436 continue-on-error : true
3537 with :
36- path : |
37- node_modules
38+ path : node_modules
3839 key : ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
3940
4041 - name : Install Dependencies
@@ -50,24 +51,29 @@ jobs:
5051 steps :
5152 - name : Checkout Repo
5253 uses : actions/checkout@v5
53-
54+
5455 - name : Setup Node.js
5556 uses : actions/setup-node@v6
5657 with :
5758 node-version : ' 20'
5859 cache : ' npm'
5960 cache-dependency-path : ' **/package-lock.json'
6061
61- # Restore node_modules from setup job
62+ - name : Install Foundry
63+ uses : foundry-rs/foundry-toolchain@50d5a8956f2e319df19e6b57539d7e2acb9f8c1e # v1.5
64+ with :
65+ version : stable
66+ cache : false
67+
68+ - name : Show Forge version
69+ run : forge --version
70+
6271 - name : Restore node_modules
63- uses : actions/cache@v4
72+ uses : actions/cache/restore @v4
6473 continue-on-error : true
6574 with :
66- path : |
67- node_modules
75+ path : node_modules
6876 key : ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
69- restore-keys : |
70- ${{ runner.os }}-node-modules-
7177
7278 - name : Ensure Dependencies
7379 run : |
@@ -76,31 +82,15 @@ jobs:
7682 npm ci --prefer-offline --no-audit
7783 fi
7884
79- # Cache Solidity compilation artifacts
80- - name : Restore compilation caches
81- id : cache-solidity
82- uses : actions/cache@v4
83- continue-on-error : true
84- with :
85- path : |
86- .test/artifacts
87- .test/cache
88- ~/.cache/hardhat
89- typechain-types
90- key : ${{ runner.os }}-solidity-${{ hashFiles('public/samples/**/*.sol', 'hardhat.config.cts') }}
91- restore-keys : |
92- ${{ runner.os }}-solidity-
85+ - name : Check Solidity Formatting
86+ run : npm run sol:fmt:check
9387
9488 - name : Check Solidity Compilation
95- run : |
96- echo "Running Solidity compilation with cache..."
97- npm run sol:compile
98-
99- - name : Check Solidity Solhint
100- run : |
101- echo "Running Solhint..."
102- npm run lint-solc
89+ run : forge build --sizes
10390
91+ - name : Check Solidity Linting
92+ run : npm run lint-solc
93+
10494 # Job 2: Check ESLint
10595 eslint :
10696 needs : setup
@@ -116,16 +106,12 @@ jobs:
116106 cache : ' npm'
117107 cache-dependency-path : ' **/package-lock.json'
118108
119- # Restore node_modules from setup job
120109 - name : Restore node_modules
121- uses : actions/cache@v4
110+ uses : actions/cache/restore @v4
122111 continue-on-error : true
123112 with :
124- path : |
125- node_modules
113+ path : node_modules
126114 key : ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
127- restore-keys : |
128- ${{ runner.os }}-node-modules-
129115
130116 - name : Ensure Dependencies
131117 run : |
@@ -159,16 +145,12 @@ jobs:
159145 cache : ' npm'
160146 cache-dependency-path : ' **/package-lock.json'
161147
162- # Restore node_modules from setup job
163148 - name : Restore node_modules
164- uses : actions/cache@v4
149+ uses : actions/cache/restore @v4
165150 continue-on-error : true
166151 with :
167- path : |
168- node_modules
152+ path : node_modules
169153 key : ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
170- restore-keys : |
171- ${{ runner.os }}-node-modules-
172154
173155 - name : Ensure Dependencies
174156 run : |
@@ -195,16 +177,12 @@ jobs:
195177 cache : ' npm'
196178 cache-dependency-path : ' **/package-lock.json'
197179
198- # Restore node_modules from setup job
199180 - name : Restore node_modules
200- uses : actions/cache@v4
181+ uses : actions/cache/restore @v4
201182 continue-on-error : true
202183 with :
203- path : |
204- node_modules
184+ path : node_modules
205185 key : ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
206- restore-keys : |
207- ${{ runner.os }}-node-modules-
208186
209187 - name : Ensure Dependencies
210188 run : |
@@ -243,16 +221,12 @@ jobs:
243221 cache : ' npm'
244222 cache-dependency-path : ' **/package-lock.json'
245223
246- # Restore node_modules from setup job
247224 - name : Restore node_modules
248- uses : actions/cache@v4
225+ uses : actions/cache/restore @v4
249226 continue-on-error : true
250227 with :
251- path : |
252- node_modules
228+ path : node_modules
253229 key : ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
254- restore-keys : |
255- ${{ runner.os }}-node-modules-
256230
257231 - name : Ensure Dependencies
258232 run : |
0 commit comments