@@ -23,18 +23,22 @@ jobs:
23
23
pull-requests : read
24
24
outputs :
25
25
affected-modules : ${{ steps.resolved-modules.outputs.module_names }}
26
- deployment- changes: ${{ steps.match-some.outputs. deployment == 'true' }}
27
- should-run-ci-core : >-
26
+ # Runs on workflow changes, any deployment change, or any (non-ignored) core change
27
+ should-run-deployment-tests : >-
28
28
${{
29
- steps.match-some.outputs.core-ci == 'true' ||
30
- steps.match-every.outputs.non-ignored == 'true' ||
29
+ steps.match-some.outputs.workflow == 'true' ||
30
+ steps.match-some.outputs.deployment == 'true' ||
31
+ steps.match-every.outputs.core-non-ignored == 'true' ||
31
32
github.event_name == 'schedule' ||
32
33
github.event_name == 'workflow_dispatch'
33
34
}}
34
- should-run-golangci : >-
35
+ # Runs on workflow changes, and any (non-ignored) core changes
36
+ should-run-core-tests : >-
35
37
${{
36
- steps.match-some.outputs.golang-ci == 'true' ||
37
- steps.match-every.outputs.non-ignored == 'true'
38
+ steps.match-some.outputs.workflow == 'true' ||
39
+ steps.match-every.outputs.core-non-ignored == 'true' ||
40
+ github.event_name == 'schedule' ||
41
+ github.event_name == 'workflow_dispatch'
38
42
}}
39
43
runs-on : ubuntu-latest
40
44
steps :
@@ -48,38 +52,33 @@ jobs:
48
52
with :
49
53
# "if any changed file matches one or more of the conditions" (https://github.com/dorny/paths-filter/issues/225)
50
54
predicate-quantifier : some
51
- # deployment - any changes to files in the `deployments/`
52
- # core-ci - any changes that could affect this workflow definition
53
- # golang-ci - any changes that could affect the linting result
55
+ # deployment - any changes in the deployment module
56
+ # workflow - any changes that could affect this workflow definition
57
+ # - Assume any repository action changes affect this workflow
54
58
filters : |
55
59
deployment:
56
60
- 'deployment/**'
57
- core-ci:
58
- - '.github/workflows/ci-core.yml'
59
- - '.github/actions/**'
60
- golang-ci:
61
- - '.golangci.yml'
61
+ workflow:
62
62
- '.github/workflows/ci-core.yml'
63
63
- '.github/actions/**'
64
64
- uses : dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
65
65
id : match-every
66
66
with :
67
67
# "if any changed file match all of the conditions" (https://github.com/dorny/paths-filter/issues/225)
68
+ # - Enables listing of files matching each filter.
69
+ # - Paths to files will be available in `${FILTER_NAME}_files` output variable.
70
+ # - Paths will be formatted as JSON array
68
71
predicate-quantifier : every
69
- # non-integration-tests - only changes made outside of the `integration-tests` directory
70
- # non-ignored - only changes except for the negated ones
72
+ # core-non-ignored - all changes except for paths which do not affect core module
73
+ # - This is opt-in on purpose. To be safe, new files are assumed to have an affect on core unless listed here specifically.
74
+ # - For example: core module does not depend on deployment or integration-tests module.
71
75
# all - changes in any directory
72
- # - This is opt-in on purpose. To be safe, new files are assumed to have an affect on CI Core unless listed here specifically.
73
- # Enable listing of files matching each filter.
74
- # Paths to files will be available in `${FILTER_NAME}_files` output variable.
75
- # Paths will be formatted as JSON array
76
+ # - This is used resolve all affected modules based on changed files
76
77
list-files : json
77
78
filters : |
78
- non-integration-tests:
79
- - '**'
80
- - '!integration-tests/**'
81
- non-ignored:
79
+ core-non-ignored:
82
80
- '**'
81
+ - '!deployment/**'
83
82
- '!integration-tests/**'
84
83
- '!tools/secrets/**'
85
84
- '!tools/goreleaser-config/**'
@@ -176,19 +175,26 @@ jobs:
176
175
type :
177
176
- cmd : go_core_tests
178
177
os : ubuntu22.04-32cores-128GB
179
- build-solana-artifacts : ' false'
178
+ should-run : ${{ needs.filter.outputs.should-run-core-tests }}
179
+
180
180
- cmd : go_core_tests_integration
181
181
os : ubuntu22.04-32cores-128GB
182
- build-solana-artifacts : ' false'
183
- - cmd : go_core_ccip_deployment_tests
184
- os : ubuntu22.04-32cores-128GB
182
+ should-run : ${{ needs.filter.outputs.should-run-core-tests }}
183
+
185
184
- cmd : go_core_fuzz
186
185
os : ubuntu22.04-8cores-32GB
187
- build-solana-artifacts : ' false'
186
+ should-run : ${{ needs.filter.outputs.should-run-core-tests }}
187
+
188
188
- cmd : go_core_race_tests
189
189
# use 64cores for certain scheduled runs only
190
190
os : ${{ needs.run-frequency.outputs.two-per-day-frequency == 'true' && 'ubuntu-latest-64cores-256GB' || 'ubuntu-latest-32cores-128GB' }}
191
- build-solana-artifacts : ' false'
191
+ should-run : ${{ needs.filter.outputs.should-run-core-tests }}
192
+
193
+ - cmd : go_core_ccip_deployment_tests
194
+ os : ubuntu22.04-32cores-128GB
195
+ build-solana-artifacts : ' true'
196
+ should-run : ${{ needs.filter.outputs.should-run-deployment-tests }}
197
+
192
198
name : Core Tests (${{ matrix.type.cmd }})
193
199
# We don't directly merge dependabot PRs, so let's not waste the resources
194
200
if : ${{ github.actor != 'dependabot[bot]' }}
@@ -210,69 +216,70 @@ jobs:
210
216
find . -type f,d -exec touch -r {} -d '1970-01-01T00:00:01' {} \; || true
211
217
212
218
- name : Setup NodeJS
213
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
219
+ if : ${{ matrix.type. should-run == 'true' }}
214
220
uses : ./.github/actions/setup-nodejs
215
221
with :
216
222
prod : " true"
217
223
218
224
- name : Install Foundry
225
+ if : ${{ matrix.type.should-run == 'true' }}
219
226
uses : ./.github/actions/install-solidity-foundry
220
227
221
228
- name : Setup Go
222
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
229
+ if : ${{ matrix.type. should-run == 'true' }}
223
230
uses : ./.github/actions/setup-go
224
231
with :
225
232
# race/fuzz tests don't benefit repeated caching, so restore from develop's build cache
226
233
restore-build-cache-only : ${{ matrix.type.cmd == 'go_core_fuzz' }}
227
234
build-cache-version : ${{ matrix.type.cmd }}
228
235
229
236
- name : Setup Solana
230
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
237
+ if : ${{ matrix.type. should-run == 'true' }}
231
238
uses : ./.github/actions/setup-solana
232
239
233
240
- name : Build Solana artifacts
234
241
# do not build for core tests, core 'integration' tests, or fuzz tests
235
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' && matrix.type.build-solana-artifacts != 'false ' }}
242
+ if : ${{ matrix.type. should-run == 'true' && matrix.type.build-solana-artifacts == 'true ' }}
236
243
uses : ./.github/actions/setup-solana/build-contracts
237
244
with :
238
245
github-token : ${{ secrets.GITHUB_TOKEN }}
239
246
240
247
- name : Setup wasmd
241
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
248
+ if : ${{ matrix.type. should-run == 'true' }}
242
249
uses : ./.github/actions/setup-wasmd
243
250
244
251
- name : Setup Postgres
245
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
252
+ if : ${{ matrix.type. should-run == 'true' }}
246
253
uses :
smartcontractkit/.github/actions/setup-postgres@7aa7ce23687ba493e9ba9c6ad47a063e60ae3433 # [email protected]
247
254
248
255
- name : Touching core/web/assets/index.html
249
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
256
+ if : ${{ matrix.type. should-run == 'true' }}
250
257
run : mkdir -p core/web/assets && touch core/web/assets/index.html
251
258
252
259
- name : Download Go vendor packages
253
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
260
+ if : ${{ matrix.type. should-run == 'true' }}
254
261
run : go mod download
255
262
256
263
- name : Setup DB
257
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
264
+ if : ${{ matrix.type. should-run == 'true' }}
258
265
run : go run ./core/store/cmd/preparetest
259
266
env :
260
267
CL_DATABASE_URL : ${{ env.DB_URL }}
261
268
262
269
- name : Install LOOP Plugins
263
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
270
+ if : ${{ matrix.type. should-run == 'true' }}
264
271
run : make install-plugins
265
272
266
273
- name : Increase Timeouts for Fuzz/Race
267
274
# Increase timeouts for scheduled runs only
268
- if : ${{ github.event.schedule != '' && needs.filter.outputs. should-run-ci-core == 'true' }}
275
+ if : ${{ github.event.schedule != '' && matrix.type. should-run == 'true' }}
269
276
run : |
270
277
echo "TIMEOUT=10m" >> $GITHUB_ENV
271
278
echo "COUNT=50" >> $GITHUB_ENV
272
279
echo "FUZZ_TIMEOUT_MINUTES=10">> $GITHUB_ENV
273
280
274
281
- name : Run tests
275
- if : ${{ needs.filter.outputs. should-run-ci-core == 'true' }}
282
+ if : ${{ matrix.type. should-run == 'true' }}
276
283
id : run-tests
277
284
env :
278
285
OUTPUT_FILE : ./output.txt
@@ -284,7 +291,7 @@ jobs:
284
291
285
292
- name : Print Races
286
293
id : print-races
287
- if : ${{ failure() && matrix.type.cmd == 'go_core_race_tests' && needs.filter.outputs. should-run-ci-core == 'true' }}
294
+ if : ${{ failure() && matrix.type.cmd == 'go_core_race_tests' && matrix.type. should-run == 'true' }}
288
295
env :
289
296
GH_REPO : ${{ github.repository }}
290
297
GH_RUN_ID : ${{ github.run_id }}
@@ -304,13 +311,13 @@ jobs:
304
311
echo "github.ref: ${{ github.ref }}"
305
312
306
313
- name : Print postgres logs
307
- if : ${{ always() && needs.filter.outputs. should-run-ci-core == 'true' }}
314
+ if : ${{ always() && matrix.type. should-run == 'true' }}
308
315
uses :
smartcontractkit/.github/actions/setup-postgres@7aa7ce23687ba493e9ba9c6ad47a063e60ae3433 # [email protected]
309
316
with :
310
317
print-logs : ' true'
311
318
312
319
- name : Store logs artifacts
313
- if : ${{ always() && needs.filter.outputs. should-run-ci-core == 'true' }}
320
+ if : ${{ always() && matrix.type. should-run == 'true' }}
314
321
uses : actions/upload-artifact@v4
315
322
with :
316
323
name : ${{ matrix.type.cmd }}_logs
@@ -328,7 +335,7 @@ jobs:
328
335
matrix.type.cmd == 'go_core_race_tests' &&
329
336
steps.print-races.outputs.post_to_slack == 'true' &&
330
337
(github.event_name == 'merge_group' || github.ref == 'refs/heads/develop') &&
331
- needs.filter.outputs. should-run-ci-core == 'true'
338
+ matrix.type. should-run == 'true'
332
339
uses : slackapi/slack-github-action@485a9d42d3a73031f12ec201c457e2162c45d02d # v2.0.0
333
340
with :
334
341
method : chat.postMessage
@@ -341,7 +348,7 @@ jobs:
341
348
name : test-scripts
342
349
needs : [filter]
343
350
runs-on : ubuntu-latest
344
- if : ${{ needs.filter.outputs.should-run-ci- core == 'true' }}
351
+ if : ${{ needs.filter.outputs.should-run-core-tests == 'true' }}
345
352
steps :
346
353
- name : Checkout
347
354
uses : actions/checkout@v4
0 commit comments