-
Notifications
You must be signed in to change notification settings - Fork 1.2k
790 lines (719 loc) · 29.1 KB
/
build-publish-images.yml
File metadata and controls
790 lines (719 loc) · 29.1 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
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# GHA for build-*
name: Build and push images
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
jobs:
#
#
#
isdraft:
uses: ./.github/workflows/reusable-isdraft.yml
preflight:
needs: isdraft
uses: ./.github/workflows/reusable-preflight.yml
### Build ########################
#
#
#
build-linux-stable:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUST_TOOLCHAIN: stable
# Enable debug assertions since we are running optimized builds for testing
# but still want to have debug assertions.
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
id: required
run: |
forklift cargo build --locked --profile testnet --features pyroscope,fast-runtime --bin polkadot --bin polkadot-prepare-worker --bin polkadot-execute-worker
ROCOCO_EPOCH_DURATION=10 ./polkadot/scripts/build-only-wasm.sh rococo-runtime $(pwd)/runtimes/rococo-runtime-10/
ROCOCO_EPOCH_DURATION=100 ./polkadot/scripts/build-only-wasm.sh rococo-runtime $(pwd)/runtimes/rococo-runtime-100/
ROCOCO_EPOCH_DURATION=600 ./polkadot/scripts/build-only-wasm.sh rococo-runtime $(pwd)/runtimes/rococo-runtime-600/
pwd
ls -alR runtimes
- name: pack artifacts
run: |
mkdir -p ./artifacts
VERSION="${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" # will be tag or branch name
mv ./target/testnet/polkadot ./artifacts/.
mv ./target/testnet/polkadot-prepare-worker ./artifacts/.
mv ./target/testnet/polkadot-execute-worker ./artifacts/.
mv ./runtimes/ ./artifacts/.
cd artifacts/
sha256sum polkadot | tee polkadot.sha256
shasum -c polkadot.sha256
cd ../
EXTRATAG="${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}"
echo "Polkadot version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
echo -n ${VERSION} > ./artifacts/VERSION
echo -n ${EXTRATAG} > ./artifacts/EXTRATAG
echo -n ${GITHUB_RUN_ID} > ./artifacts/BUILD_LINUX_JOB_ID
RELEASE_VERSION=$(./artifacts/polkadot -V | awk '{print $2}'| awk -F "-" '{print $1}')
echo -n "v${RELEASE_VERSION}" > ./artifacts/BUILD_RELEASE_VERSION
cp -r docker/* ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
#
#
#
build-linux-stable-cumulus:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
id: required
run: |
echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
forklift cargo build --release --locked -p polkadot-parachain-bin --bin polkadot-parachain
echo "___Packing the artifacts___"
mkdir -p ./artifacts
mv ./target/release/polkadot-parachain ./artifacts/.
echo "___The VERSION is either a tag name or the curent branch if triggered not by a tag___"
echo ${{ needs.preflight.outputs.SOURCE_REF_SLUG }} | tee ./artifacts/VERSION
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
#
#
#
build-test-parachain:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
RUSTFLAGS: "-Cdebug-assertions=y -Dwarnings"
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
id: required
run: |
echo "___Building a binary, please refrain from using it in production since it goes with the debug assertions.___"
forklift cargo build --release --locked -p cumulus-test-service --bin test-parachain
- name: pack artifacts
run: |
echo "___Packing the artifacts___"
mkdir -p ./artifacts
mv ./target/release/test-parachain ./artifacts/.
mkdir -p ./artifacts/zombienet
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
#
#
#
build-test-collators:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
id: required
run: |
forklift cargo build --locked --profile testnet -p test-parachain-adder-collator
forklift cargo build --locked --profile testnet -p test-parachain-undying-collator
- name: pack artifacts
run: |
mkdir -p ./artifacts
mv ./target/testnet/adder-collator ./artifacts/.
mv ./target/testnet/undying-collator ./artifacts/.
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
echo "adder-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
echo "undying-collator version = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
cp -r ./docker/* ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
#
#
#
build-malus:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
id: required
run: |
forklift cargo build --locked --profile testnet -p polkadot-test-malus --bin malus --bin polkadot-prepare-worker --bin polkadot-execute-worker
- name: pack artifacts
run: |
mkdir -p ./artifacts
mv ./target/testnet/malus ./artifacts/.
mv ./target/testnet/polkadot-execute-worker ./artifacts/.
mv ./target/testnet/polkadot-prepare-worker ./artifacts/.
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
cp -r ./docker/* ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
#
#
#
build-linux-substrate:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
id: required
run: |
mkdir -p ./artifacts/substrate/
WASM_BUILD_NO_COLOR=1 forklift cargo build --locked --release -p staging-node-cli
ls -la target/release/
- name: pack artifacts
shell: bash
run: |
mv target/release/substrate-node ./artifacts/substrate/substrate
echo -n "Substrate version = "
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
echo "${{ github.ref_name }}" | tee ./artifacts/substrate/VERSION;
else
./artifacts/substrate/substrate --version |
cut -d ' ' -f 2 | tee ./artifacts/substrate/VERSION;
fi
sha256sum ./artifacts/substrate/substrate | tee ./artifacts/substrate/substrate.sha256
cp -r ./docker/dockerfiles/substrate_injected.Dockerfile ./artifacts/substrate/
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
#
#
#
build-templates-node:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
id: required
run: |
forklift cargo build --locked --package parachain-template-node --release
forklift cargo build --locked --package minimal-template-node --release
forklift cargo build --locked --package solochain-template-node --release
- name: pack artifacts
run: |
mkdir -p ./artifacts
mv ./target/release/parachain-template-node ./artifacts/.
mv ./target/release/minimal-template-node ./artifacts/.
mv ./target/release/solochain-template-node ./artifacts/.
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}" > ./artifacts/VERSION
echo -n "${{ needs.preflight.outputs.SOURCE_REF_SLUG }}-${COMMIT_SHA}" > ./artifacts/EXTRATAG
echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
- name: Stop all workflows if failed
if: ${{ failure() && steps.required.conclusion == 'failure' && !github.event.pull_request.head.repo.fork }}
uses: ./.github/actions/workflow-stopper
with:
app-id: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_ID }}
app-key: ${{ secrets.WORKFLOW_STOPPER_RUNNER_APP_KEY }}
### Build zombienet test artifacts ########################
#
#
#
prepare-bridges-zombienet-artifacts:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
run: |
forklift cargo build --locked --profile testnet -p polkadot-test-malus --bin malus --bin polkadot-prepare-worker --bin polkadot-execute-worker
- name: pack artifacts
run: |
mkdir -p ./artifacts/bridges-polkadot-sdk/bridges
cp -r bridges/testing ./artifacts/bridges-polkadot-sdk/bridges/testing
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
prepare-polkadot-zombienet-artifacts:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
run: |
forklift cargo nextest --manifest-path polkadot/zombienet-sdk-tests/Cargo.toml archive --locked --features zombie-metadata,zombie-ci --archive-file polkadot-zombienet-tests.tar.zst
- name: pack artifacts
run: |
mkdir -p artifacts
cp polkadot-zombienet-tests.tar.zst ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
prepare-substrate-zombienet-artifacts:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
run: |
forklift cargo nextest --manifest-path substrate/zombienet/zombienet-sdk/Cargo.toml archive --locked --features zombie-ci --archive-file substrate-zombienet-tests.tar.zst
- name: pack artifacts
run: |
mkdir -p artifacts
cp substrate-zombienet-tests.tar.zst ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
#
#
#
prepare-cumulus-zombienet-artifacts:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
run: |
forklift cargo nextest --manifest-path cumulus/zombienet/zombienet-sdk/Cargo.toml archive --locked --features zombie-ci --archive-file cumulus-zombienet-tests.tar.zst
- name: pack artifacts
run: |
mkdir -p artifacts
cp cumulus-zombienet-tests.tar.zst ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
prepare-parachain-templates-zombienet-artifacts:
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
timeout-minutes: 60
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: build
run: |
forklift cargo nextest --manifest-path templates/zombienet/Cargo.toml archive --locked --features zombienet --archive-file parachain-templates-zombienet-tests.tar.zst
- name: pack artifacts
run: |
mkdir -p artifacts
cp parachain-templates-zombienet-tests.tar.zst ./artifacts
- name: tar
run: tar -cvf artifacts.tar artifacts
- name: upload artifacts
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ github.job }}-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
path: artifacts.tar
retention-days: 1
### Publish ########################
#
#
#
build-push-image-test-parachain:
needs: [preflight, build-test-parachain]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build-test-parachain-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "test-parachain"
dockerfile: "docker/dockerfiles/test-parachain_injected.Dockerfile"
username: ${{ secrets.PARITYPR_DOCKERHUB_USERNAME }}
password: ${{ secrets.PARITYPR_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-polkadot-debug:
needs: [preflight, build-linux-stable]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build-linux-stable-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "polkadot-debug"
dockerfile: "docker/dockerfiles/polkadot/polkadot_injected_debug.Dockerfile"
username: ${{ secrets.PARITYPR_DOCKERHUB_USERNAME }}
password: ${{ secrets.PARITYPR_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-colander:
needs: [preflight, build-test-collators]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build-test-collators-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "colander"
dockerfile: "docker/dockerfiles/collator_injected.Dockerfile"
username: ${{ secrets.PARITYPR_DOCKERHUB_USERNAME }}
password: ${{ secrets.PARITYPR_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-malus:
needs: [preflight, build-malus]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build-malus-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "malus"
dockerfile: "docker/dockerfiles/malus_injected.Dockerfile"
username: ${{ secrets.PARITYPR_DOCKERHUB_USERNAME }}
password: ${{ secrets.PARITYPR_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-substrate-pr:
needs: [preflight, build-linux-substrate]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build-linux-substrate-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "substrate"
dockerfile: "docker/dockerfiles/substrate_injected.Dockerfile"
username: ${{ secrets.PARITYPR_DOCKERHUB_USERNAME }}
password: ${{ secrets.PARITYPR_DOCKERHUB_PASSWORD }}
#
#
#
# unlike other images, bridges+zombienet image is based on Zombienet image that pulls required binaries
# from other fresh images (polkadot and cumulus)
build-push-image-bridges-zombienet-tests:
needs:
[
preflight,
build-linux-stable,
build-linux-stable-cumulus,
prepare-bridges-zombienet-artifacts,
]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build-linux-stable-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: |
tar -xvf artifacts.tar
rm artifacts.tar
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build-linux-stable-cumulus-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: |
tar -xvf artifacts.tar
rm artifacts.tar
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: prepare-bridges-zombienet-artifacts-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: |
tar -xvf artifacts.tar
rm artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "bridges-zombienet-tests"
dockerfile: "docker/dockerfiles/bridges_zombienet_tests_injected.Dockerfile"
username: ${{ secrets.PARITYPR_DOCKERHUB_USERNAME }}
password: ${{ secrets.PARITYPR_DOCKERHUB_PASSWORD }}
#
#
#
build-push-image-polkadot-parachain-debug:
needs: [preflight, build-linux-stable-cumulus]
runs-on: ${{ needs.preflight.outputs.RUNNER_DEFAULT }}
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: build-linux-stable-cumulus-${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
- name: tar
run: tar -xvf artifacts.tar
- name: build and push image
uses: ./.github/actions/build-push-image
with:
image-name: "polkadot-parachain-debug"
dockerfile: "docker/dockerfiles/polkadot-parachain/polkadot-parachain-debug_unsigned_injected.Dockerfile"
username: ${{ secrets.PARITYPR_DOCKERHUB_USERNAME }}
password: ${{ secrets.PARITYPR_DOCKERHUB_PASSWORD }}
confirm-required-build-jobs-passed:
runs-on: ubuntu-latest
name: All builds passed
# If any new job gets added, be sure to add it to this array
needs:
- build-linux-stable
- build-linux-stable-cumulus
- build-test-parachain
- build-test-collators
- build-malus
- build-linux-substrate
- build-templates-node
if: always() && !cancelled()
outputs:
build_success: ${{ steps.check_success.outputs.build_success }}
steps:
- name: Check build success
id: check_success
run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep -E '"result": "(failure|cancelled)"' | wc -l)
if [ $FAILURES -gt 0 ]; then
echo "### At least one required job failed ❌" >> $GITHUB_STEP_SUMMARY
echo "build_success=false" >> $GITHUB_OUTPUT
exit 1
else
echo '### Good job! All the required jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
echo "build_success=true" >> $GITHUB_OUTPUT
fi
trigger-zombienet-polkadot:
needs: [preflight, confirm-required-build-jobs-passed]
if: ${{ needs.confirm-required-build-jobs-passed.outputs.build_success == 'true' }}
uses: ./.github/workflows/zombienet_polkadot.yml
with:
build_run_id: ${{ github.run_id }}
ref_slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
trigger-zombienet-cumulus:
needs: [preflight, confirm-required-build-jobs-passed]
if: ${{ needs.confirm-required-build-jobs-passed.outputs.build_success == 'true' }}
uses: ./.github/workflows/zombienet_cumulus.yml
with:
build_run_id: ${{ github.run_id }}
ref_slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
trigger-zombienet-substrate:
needs: [preflight, confirm-required-build-jobs-passed]
if: ${{ needs.confirm-required-build-jobs-passed.outputs.build_success == 'true' }}
uses: ./.github/workflows/zombienet_substrate.yml
with:
build_run_id: ${{ github.run_id }}
ref_slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
trigger-zombienet-parachain-template:
needs: [preflight, confirm-required-build-jobs-passed]
if: ${{ needs.confirm-required-build-jobs-passed.outputs.build_success == 'true' }}
uses: ./.github/workflows/zombienet_parachain-template.yml
with:
build_run_id: ${{ github.run_id }}
ref_slug: ${{ needs.preflight.outputs.SOURCE_REF_SLUG }}
confirm-zombienet-tests-passed:
runs-on: ubuntu-latest
name: All zombienet tests passed
needs:
# Disabled until zombienet polkadot/cumulus flows are stable
# - trigger-zombienet-polkadot
# - trigger-zombienet-cumulus
- trigger-zombienet-substrate
- trigger-zombienet-parachain-template
if: always() && !cancelled()
steps:
- name: Check zombienet success
id: check_success
run: |
tee resultfile <<< '${{ toJSON(needs) }}'
FAILURES=$(cat resultfile | grep -E '"result": "(failure|cancelled)"' | wc -l)
if [ "$FAILURES" -gt 0 ]; then
echo "### At least one zombienet job failed ❌" >> $GITHUB_STEP_SUMMARY
exit 1
else
echo '### Good job! All zombienet jobs passed 🚀' >> $GITHUB_STEP_SUMMARY
fi