-
Notifications
You must be signed in to change notification settings - Fork 865
537 lines (502 loc) · 18.7 KB
/
Copy pathgo-ci-pre-merge.yml
File metadata and controls
537 lines (502 loc) · 18.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
name: Go
on:
push:
tags:
- "*"
branches:
- master
- dev
pull_request:
merge_group:
types: [checks_requested]
permissions:
contents: read
# Cancel ongoing workflow runs if a new one is started
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
go-required:
if: ${{ always() }}
needs:
- build-antithesis-images-avalanchego
- build-antithesis-images-subnet-evm
- build-image-avalanchego
- build-image-subnet-evm
- check-contract-bindings
- check-generated-canoto
- check-generated-mocks
- check-generated-protobuf
- check-go-mod-tidy
- check-links
- check-tauseconds
- e2e
- e2e-bootstrap-monitor
- e2e-existing-network
- e2e-kube
- e2e-load-subnet-evm
- e2e-post-latest
- e2e-schedule-latest
- e2e-warp-coreth
- e2e-warp-subnet-evm
- fuzz
- lint-avalanchego
- lint-coreth
- lint-evm
- lint-subnet-evm
- load
# Re-enable once images are built by Bazel and can be cached; otherwise, this job is too expensive for what it evaluates.
# - load_kube_kind
- robustness
- smoke
- unit
- upgrade
runs-on: ubuntu-24.04
steps:
- name: Fail unless all needed jobs succeeded
shell: bash
env:
NEEDS_JSON: ${{ toJSON(needs) }}
run: |
failed_jobs="$(
jq -r '
to_entries[]
| select(.value.result != "success")
| .key
' <<<"$NEEDS_JSON"
)"
if [[ -n "$failed_jobs" ]]; then
echo "Required jobs failed:"
printf '%s\n' "$failed_jobs"
exit 1
fi
build-antithesis-images-avalanchego:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-go-for-project
- name: Check image build for avalanchego test setup
uses: ./.github/actions/run-docker-with-disk-space
with:
run: ./scripts/run_task.sh test-build-antithesis-images-avalanchego
build-antithesis-images-subnet-evm:
# Use a faster runner pending migration to bazel. The default free runners result
# in 20+ minute runtime, slowing down every PR and merge queue CI run.
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-go-for-project
- name: Check image build for subnet-evm test setup
uses: ./.github/actions/run-docker-with-disk-space
with:
run: ./scripts/run_task.sh test-build-antithesis-images-subnet-evm
build-image-avalanchego:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Check image build
uses: ./.github/actions/run-docker-with-disk-space
with:
setup-qemu: 'true'
run: ./scripts/run_task.sh test-build-image
build-image-subnet-evm:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Check image build
uses: ./.github/actions/run-docker-with-disk-space
with:
setup-qemu: 'true'
run: ./scripts/run_task.sh test-build-image
working_directory: ./graft/subnet-evm
check-contract-bindings:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop --command bash -x {0}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-nix
- run: ./scripts/run_task.sh check-generate-load-contract-bindings
check-generated-canoto:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-go-for-project
- shell: bash
run: ./scripts/run_task.sh check-generate-canoto
check-generated-mocks:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-go-for-project
- shell: bash
run: ./scripts/run_task.sh check-generate-mocks
check-generated-protobuf:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop --command bash -x {0}
steps:
- uses: actions/checkout@v5
# Use the dev shell instead of bufbuild/buf-action to ensure the dev shell provides the expected versions
- uses: ./.github/actions/install-nix
- run: ./scripts/run_task.sh check-generate-protobuf
check-go-mod-tidy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-go-for-project
- shell: bash
run: ./scripts/run_task.sh check-go-mod-tidy
check-links:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: umbrelladocs/action-linkspector@de84085e0f51452a470558693d7d308fbb2fa261 # v1.2.5
with:
fail_level: any
check-tauseconds:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Check for TauSeconds misuse with time.Add()
run: |
if grep -rn '\.Add([^)]*TauSeconds' --include='*.go' .; then
echo "ERROR: Use params.Tau (time.Duration) with time.Add(), not TauSeconds (int)"
echo "TauSeconds would be interpreted as nanoseconds, not seconds"
exit 1
fi
e2e:
name: e2e (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# The default free runners lack the resources for parallel execution, so
# a beefier runner is required.
os: [blacksmith-4vcpu-ubuntu-2404]
steps:
- uses: actions/checkout@v5
- name: Run e2e tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-ci
artifact_prefix: e2e-${{ matrix.os }}
filter_by_owner: avalanchego-e2e
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
e2e-bootstrap-monitor:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop --command bash -x {0}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/ensure-disk-space
with:
diagnostic-groups: docker
- uses: ./.github/actions/install-nix
- name: Run e2e tests
run: ./scripts/run_task.sh test-bootstrap-monitor-e2e
- name: Log Docker disk diagnostics
if: failure()
shell: bash
run: ./scripts/run_task.sh log-ci-disk-state-docker
- name: Collect kind diagnostics
if: failure()
uses: ./.github/actions/collect-kind-diagnostics
with:
artifact_name: bootstrap-monitor-kind-diagnostics
e2e-existing-network:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Run e2e tests with existing network
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-existing-ci
artifact_prefix: e2e-existing-network
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
e2e-kube:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-kube-ci
runtime: kube
artifact_prefix: e2e-kube
filter_by_owner: avalanchego-e2e
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
e2e-load-subnet-evm:
runs-on: ubuntu-24.04
steps:
- name: Git checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Run E2E Load Tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-load-ci
working_directory: ./graft/subnet-evm
artifact_prefix: load
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
e2e-post-latest:
# The default free runners lack the resources for parallel execution, so a beefier
# runner is required.
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- name: Run e2e tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-ci-post-latest
artifact_prefix: e2e-post-latest
filter_by_owner: avalanchego-e2e
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
e2e-schedule-latest:
# The default free runners lack the resources for parallel execution, so a beefier
# runner is required.
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: actions/checkout@v5
- name: Run e2e tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-ci-schedule-latest
artifact_prefix: e2e-schedule-latest
filter_by_owner: avalanchego-e2e
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
e2e-warp-coreth:
runs-on: ubuntu-24.04
steps:
- name: Git checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Run Warp E2E Tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-warp-ci
working_directory: ./graft/coreth
artifact_prefix: warp
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
e2e-warp-subnet-evm:
runs-on: ubuntu-24.04
steps:
- name: Git checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Run Warp E2E Tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-e2e-warp-ci
working_directory: ./graft/subnet-evm
artifact_prefix: warp
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
fuzz:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-go-for-project
- name: test-fuzz
shell: bash
run: ./scripts/run_task.sh test-fuzz
lint-avalanchego:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop --command bash -x {0}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-nix
- name: Runs all lint checks
run: ./scripts/run_task.sh lint-all-ci
lint-coreth:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop --command bash -x {0}
working-directory: ./graft/coreth
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-nix
- name: Run all lint checks
run: ./scripts/run_task.sh lint-all-ci
- name: Check go.mod and go.sum are up-to-date
run: ./scripts/run_task.sh check-go-mod-tidy
lint-evm:
runs-on: ubuntu-24.04
defaults:
run:
working-directory: ./graft/evm
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-go-for-project
- name: Run all lint checks
run: ../../scripts/run_task.sh lint-all-ci
- name: Check go.mod and go.sum are up-to-date
run: ../../scripts/run_task.sh check-go-mod-tidy
lint-subnet-evm:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop --command bash -x {0}
working-directory: ./graft/subnet-evm
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-nix
- name: Run all lint checks
run: ./scripts/run_task.sh lint-all-ci
- name: Check go.mod and go.sum are up-to-date
run: ./scripts/run_task.sh check-go-mod-tidy
load:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-load-ci
artifact_prefix: load
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
# Re-enable once images are built by Bazel and can be cached; otherwise, this job is too expensive for what it evaluates.
# load_kube_kind:
# name: Run load test on kind cluster
# runs-on: ubuntu-24.04
# steps:
# - uses: actions/checkout@v5
# - uses: ./.github/actions/run-monitored-tmpnet-cmd
# with:
# run: ./scripts/run_task.sh test-load-kube-kind-ci
# runtime: kube
# artifact_prefix: load-kube
# prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
# prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
# prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
# prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
# loki_url: ${{ secrets.LOKI_URL || '' }}
# loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
# loki_username: ${{ secrets.LOKI_USERNAME || '' }}
# loki_password: ${{ secrets.LOKI_PASSWORD || '' }}
robustness:
runs-on: ubuntu-24.04
defaults:
run:
shell: nix develop --command bash -x {0}
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/ensure-disk-space
with:
diagnostic-groups: docker
- uses: ./.github/actions/install-nix
# TODO(marun) Extend testing of robustness beyond deploying a suitable test environment
- name: Deploy kind with chaos mesh
run: ./scripts/run_task.sh test-robustness
- name: Log Docker disk diagnostics
if: failure()
shell: bash
run: ./scripts/run_task.sh log-ci-disk-state-docker
- name: Collect kind diagnostics
if: failure()
uses: ./.github/actions/collect-kind-diagnostics
with:
artifact_name: robustness-kind-diagnostics
# macOS runners are slower and less reliable than Linux runners.
# Pre-merge CI runs only a smoke test on macOS. The scheduled Go workflow
# runs the full suite on macOS.
smoke:
name: darwin-arm64
uses: ./.github/workflows/go-ci-smoke.yml
with:
platform_name: darwin-arm64
runner: macos-26
secrets: inherit
unit:
name: linux-amd64
uses: ./.github/workflows/go-ci.yml
with:
platform_name: linux-amd64
runner: ubuntu-24.04
secrets: inherit
upgrade:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- name: Run e2e tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/run_task.sh test-upgrade
artifact_prefix: upgrade
prometheus_url: ${{ secrets.PROMETHEUS_URL || '' }}
prometheus_push_url: ${{ secrets.PROMETHEUS_PUSH_URL || '' }}
prometheus_username: ${{ secrets.PROMETHEUS_USERNAME || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_url: ${{ secrets.LOKI_URL || '' }}
loki_push_url: ${{ secrets.LOKI_PUSH_URL || '' }}
loki_username: ${{ secrets.LOKI_USERNAME || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}