forked from paritytech/polkadot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
1098 lines (1022 loc) · 43.2 KB
/
.gitlab-ci.yml
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
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# .gitlab-ci.yml
#
# polkadot
#
# Pipelines can be triggered manually in the web.
#
# Please do not add new jobs without "rules:" and "*-env". There are &test-refs for everything,
# "docker-env" is used for Rust jobs.
# And "kubernetes-env" for everything else. Please mention "image:" container name to be used
# with it, as there's no default one.
# All jobs are sorted according to their duration using DAG mechanism
# Currently, test-linux-stable job is the longest one and other jobs are
# sorted in order to complete during this job and occupy less runners in one
# moment of time.
stages:
- stage1
- stage2
- stage3
- stage4
workflow:
rules:
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH
variables:
GIT_STRATEGY: fetch
GIT_DEPTH: 100
CI_SERVER_NAME: "GitLab CI"
CI_IMAGE: "paritytech/ci-linux:production"
DOCKER_OS: "debian:stretch"
ARCH: "x86_64"
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.2.67"
PIPELINE_SCRIPTS_TAG: "v0.4"
default:
cache: {}
.collect-artifacts: &collect-artifacts
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 7 days
paths:
- ./artifacts/
.collect-artifacts-short: &collect-artifacts-short
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
when: on_success
expire_in: 1 days
paths:
- ./artifacts/
# collecting vars for pipeline stopper
# they will be used if the job fails
.pipeline-stopper-vars: &pipeline-stopper-vars
- echo "FAILED_JOB_URL=${CI_JOB_URL}" > pipeline-stopper.env
- echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env
- echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env
- echo "PR_NUM=${CI_COMMIT_REF_NAME}" >> pipeline-stopper.env
.pipeline-stopper-artifacts: &pipeline-stopper-artifacts
artifacts:
reports:
dotenv: pipeline-stopper.env
.kubernetes-env: &kubernetes-env
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
interruptible: true
tags:
- kubernetes-parity-build
.docker-env: &docker-env
image: "${CI_IMAGE}"
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
interruptible: true
tags:
- linux-docker
.compiler-info: &compiler-info
before_script:
- rustup show
- cargo --version
- sccache -s
.test-refs: &test-refs
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
.common-refs: &common-refs
# these jobs run always*
rules:
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
- if: $CI_COMMIT_REF_NAME =~ /^release-v[0-9]+\.[0-9]+.*$/ # i.e. release-v0.9.27
.test-pr-refs: &test-pr-refs
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
.zombienet-refs: &zombienet-refs
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
.deploy-testnet-refs: &deploy-testnet-refs
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
.publish-refs: &publish-refs
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "web" &&
$CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
.build-push-image: &build-push-image
<<: *kubernetes-env
image: quay.io/buildah/stable
variables: &image-variables
GIT_STRATEGY: none
DOCKER_USER: ${PARITYPR_USER}
DOCKER_PASS: ${PARITYPR_PASS}
before_script: &check-versions
- test -s ./artifacts/VERSION || exit 1
- test -s ./artifacts/EXTRATAG || exit 1
- VERSION="$(cat ./artifacts/VERSION)"
- EXTRATAG="$(cat ./artifacts/EXTRATAG)"
- echo "Polkadot version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
script:
- test "$DOCKER_USER" -a "$DOCKER_PASS" ||
( echo "no docker credentials provided"; exit 1 )
- cd ./artifacts
- buildah bud
--format=docker
--build-arg VCS_REF="${CI_COMMIT_SHA}"
--build-arg BUILD_DATE="$(date -u '+%Y-%m-%dT%H:%M:%SZ')"
--build-arg IMAGE_NAME="${IMAGE_NAME}"
--tag "$IMAGE_NAME:$VERSION"
--tag "$IMAGE_NAME:$EXTRATAG"
--file ${DOCKERFILE} .
# The job will success only on the protected branch
- echo "$DOCKER_PASS" |
buildah login --username "$DOCKER_USER" --password-stdin docker.io
- buildah info
- buildah push --format=v2s2 "$IMAGE_NAME:$VERSION"
- buildah push --format=v2s2 "$IMAGE_NAME:$EXTRATAG"
after_script:
- buildah logout --all
#### stage: stage1
check-runtime:
stage: stage1
image: paritytech/tools:latest
<<: *kubernetes-env
rules:
- if: $CI_COMMIT_REF_NAME =~ /^release-v[0-9]+\.[0-9]+.*$/ # i.e. release-v0.9.27
variables:
GITLAB_API: "https://gitlab.parity.io/api/v4"
GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api"
script:
- ./scripts/ci/gitlab/check_runtime.sh
allow_failure: true
cargo-fmt:
stage: stage1
<<: *docker-env
<<: *test-refs
script:
- cargo +nightly --version
- cargo +nightly fmt --all -- --check
allow_failure: true
build-linux-stable:
stage: stage1
<<: *docker-env
<<: *compiler-info
<<: *collect-artifacts
<<: *common-refs
variables:
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"
# Ensure we run the UI tests.
RUN_UI_TESTS: 1
script:
- time cargo build --profile testnet --features pyroscope --verbose --bin polkadot
- sccache -s
# pack artifacts
- mkdir -p ./artifacts
- VERSION="${CI_COMMIT_REF_NAME}" # will be tag or branch name
- mv ./target/testnet/polkadot ./artifacts/.
- pushd artifacts
- sha256sum polkadot | tee polkadot.sha256
- shasum -c polkadot.sha256
- popd
- EXTRATAG="${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}"
- echo "Polkadot version = ${VERSION} (EXTRATAG = ${EXTRATAG})"
- echo -n ${VERSION} > ./artifacts/VERSION
- echo -n ${EXTRATAG} > ./artifacts/EXTRATAG
- echo -n ${CI_JOB_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 scripts/* ./artifacts
test-linux-stable:
stage: stage1
<<: *docker-env
<<: *common-refs
<<: *pipeline-stopper-artifacts
before_script:
- rustup show
- cargo --version
- *pipeline-stopper-vars
variables:
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"
script:
- time cargo test --workspace --profile testnet --verbose --locked --features=runtime-benchmarks,runtime-metrics
spellcheck:
stage: stage1
<<: *docker-env
<<: *test-refs
script:
- cargo spellcheck --version
# compare with the commit parent to the PR, given it's from a default branch
- git fetch origin +${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH}
- echo "___Spellcheck is going to check your diff___"
- cargo spellcheck list-files -vvv $(git diff --diff-filter=AM --name-only $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH} -- :^bridges))
- time cargo spellcheck check -vvv --cfg=scripts/ci/gitlab/spellcheck.toml --checkers hunspell --code 1
$(git diff --diff-filter=AM --name-only $(git merge-base ${CI_COMMIT_SHA} ${CI_DEFAULT_BRANCH} -- :^bridges))
allow_failure: true
build-test-collators:
stage: stage1
<<: *collect-artifacts
<<: *docker-env
<<: *compiler-info
<<: *test-refs
script:
- time cargo build --profile testnet --verbose -p test-parachain-adder-collator
- time cargo build --profile testnet --verbose -p test-parachain-undying-collator
- sccache -s
# pack artifacts
- mkdir -p ./artifacts
- mv ./target/testnet/adder-collator ./artifacts/.
- mv ./target/testnet/undying-collator ./artifacts/.
- echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_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 ./scripts/* ./artifacts
build-malus:
stage: stage1
<<: *collect-artifacts
<<: *docker-env
<<: *compiler-info
<<: *test-refs
script:
- time cargo build --profile testnet --verbose -p polkadot-test-malus
- sccache -s
# pack artifacts
- mkdir -p ./artifacts
- mv ./target/testnet/malus ./artifacts/.
- echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- echo "polkadot-test-malus = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- cp -r ./scripts/* ./artifacts
build-staking-miner:
stage: stage1
<<: *collect-artifacts
<<: *docker-env
<<: *compiler-info
<<: *common-refs
script:
- time cargo build --locked --release --package staking-miner
# pack artifacts
- mkdir -p ./artifacts
- mv ./target/release/staking-miner ./artifacts/.
- echo -n "${CI_COMMIT_REF_NAME}" > ./artifacts/VERSION
- echo -n "${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}" > ./artifacts/EXTRATAG
- echo "staking-miner = $(cat ./artifacts/VERSION) (EXTRATAG = $(cat ./artifacts/EXTRATAG))"
- cp -r ./scripts/* ./artifacts
#### stage: stage2
.check-dependent-project: &check-dependent-project
stage: stage2
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: cargo-fmt
artifacts: false
<<: *docker-env
<<: *test-pr-refs
script:
- git clone
--depth=1
"--branch=$PIPELINE_SCRIPTS_TAG"
https://github.com/paritytech/pipeline-scripts
- ./pipeline-scripts/check_dependent_project.sh
--org paritytech
--dependent-repo "$DEPENDENT_REPO"
--github-api-token "$GITHUB_PR_TOKEN"
--extra-dependencies "$EXTRA_DEPENDENCIES"
--companion-overrides "$COMPANION_OVERRIDES"
check-dependent-cumulus:
<<: *check-dependent-project
variables:
DEPENDENT_REPO: cumulus
EXTRA_DEPENDENCIES: substrate
COMPANION_OVERRIDES: |
polkadot: release-v*
cumulus: polkadot-v*
test-node-metrics:
stage: stage2
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: cargo-fmt
artifacts: false
<<: *docker-env
<<: *compiler-info
<<: *test-refs
variables:
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"
script:
- time cargo test --profile testnet --verbose --locked --features=runtime-metrics -p polkadot-node-metrics
test-deterministic-wasm:
stage: stage2
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: cargo-fmt
artifacts: false
<<: *test-refs
<<: *docker-env
<<: *compiler-info
script:
- ./scripts/ci/gitlab/test_deterministic_wasm.sh
check-transaction-versions:
stage: stage2
<<: *test-refs
<<: *docker-env
image: node:15
needs:
- job: build-linux-stable
artifacts: true
before_script:
- apt-get -y update; apt-get -y install jq lsof
- npm install --ignore-scripts -g @polkadot/metadata-cmp
# Set git config
- git config remote.origin.url "https://github.com/paritytech/polkadot.git"
- git fetch origin release
script:
- ./scripts/ci/gitlab/check_extrinsics_ordering.sh
# This image is used in testnets
# Release image is handled by the Github Action here:
# .github/workflows/publish-docker-release.yml
publish-polkadot-debug-image:
stage: stage2
<<: *build-push-image
rules:
# Don't run when triggered from another pipeline
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_COMMIT_REF_NAME == "master"
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
- if: $CI_COMMIT_REF_NAME =~ /^v[0-9]+\.[0-9]+.*$/ # i.e. v1.0, v2.1rc1
variables:
<<: *image-variables
# scripts/ci/dockerfiles/polkadot_injected_debug.Dockerfile
DOCKERFILE: ci/dockerfiles/polkadot_injected_debug.Dockerfile
IMAGE_NAME: docker.io/paritypr/polkadot-debug
needs:
- job: build-linux-stable
artifacts: true
after_script:
# pass artifacts to the zombienet-tests job
# https://docs.gitlab.com/ee/ci/multi_project_pipelines.html#with-variable-inheritance
- echo "PARACHAINS_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/parachains.env
- echo "PARACHAINS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/parachains.env
artifacts:
reports:
# this artifact is used in zombienet-tests job
dotenv: ./artifacts/parachains.env
expire_in: 1 days
publish-test-collators-image:
# service image for Simnet
stage: stage2
<<: *build-push-image
<<: *zombienet-refs
variables:
<<: *image-variables
# scripts/ci/dockerfiles/collator_injected.Dockerfile
DOCKERFILE: ci/dockerfiles/collator_injected.Dockerfile
IMAGE_NAME: docker.io/paritypr/colander
needs:
- job: build-test-collators
artifacts: true
after_script:
- buildah logout --all
# pass artifacts to the zombienet-tests job
- echo "COLLATOR_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/collator.env
- echo "COLLATOR_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/collator.env
artifacts:
reports:
# this artifact is used in zombienet-tests job
dotenv: ./artifacts/collator.env
publish-malus-image:
# service image for Simnet
stage: stage2
<<: *build-push-image
<<: *zombienet-refs
variables:
<<: *image-variables
# scripts/ci/dockerfiles/malus_injected.Dockerfile
DOCKERFILE: ci/dockerfiles/malus_injected.Dockerfile
IMAGE_NAME: docker.io/paritypr/malus
needs:
- job: build-malus
artifacts: true
after_script:
- buildah logout "$IMAGE_NAME"
# pass artifacts to the zombienet-tests job
- echo "MALUS_IMAGE_NAME=${IMAGE_NAME}" > ./artifacts/malus.env
- echo "MALUS_IMAGE_TAG=$(cat ./artifacts/EXTRATAG)" >> ./artifacts/malus.env
artifacts:
reports:
# this artifact is used in zombienet-tests job
dotenv: ./artifacts/malus.env
publish-staking-miner-image:
stage: stage2
<<: *build-push-image
<<: *publish-refs
variables:
<<: *image-variables
# scripts/ci/dockerfiles/staking-miner/staking-miner_injected.Dockerfile
DOCKERFILE: ci/dockerfiles/staking-miner/staking-miner_injected.Dockerfile
IMAGE_NAME: docker.io/paritytech/staking-miner
GIT_STRATEGY: none
DOCKER_USER: ${Docker_Hub_User_Parity}
DOCKER_PASS: ${Docker_Hub_Pass_Parity}
needs:
- job: build-staking-miner
artifacts: true
publish-s3-release: &publish-s3
stage: stage3
needs:
- job: build-linux-stable
artifacts: true
<<: *kubernetes-env
image: paritytech/awscli:latest
variables:
GIT_STRATEGY: none
PREFIX: "builds/polkadot/${ARCH}-${DOCKER_OS}"
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
# publishing binaries nightly
- if: $CI_PIPELINE_SOURCE == "schedule"
before_script:
- *check-versions
script:
- echo "uploading objects to https://releases.parity.io/${PREFIX}/${VERSION}"
- aws s3 sync --acl public-read ./artifacts/ s3://${AWS_BUCKET}/${PREFIX}/${VERSION}/
- echo "update objects at https://releases.parity.io/${PREFIX}/${EXTRATAG}"
- find ./artifacts -type f | while read file; do
name="${file#./artifacts/}";
aws s3api copy-object
--copy-source ${AWS_BUCKET}/${PREFIX}/${VERSION}/${name}
--bucket ${AWS_BUCKET} --key ${PREFIX}/${EXTRATAG}/${name};
done
- |
cat <<-EOM
|
| polkadot binary paths:
|
| - https://releases.parity.io/${PREFIX}/${EXTRATAG}/polkadot
| - https://releases.parity.io/${PREFIX}/${VERSION}/polkadot
|
EOM
after_script:
- aws s3 ls s3://${AWS_BUCKET}/${PREFIX}/${EXTRATAG}/
--recursive --human-readable --summarize
update_polkadot_weights: &update-weights
stage: stage2
timeout: 1d
when: manual
variables:
RUNTIME: polkadot
artifacts:
paths:
- ${RUNTIME}_weights_${CI_COMMIT_SHORT_SHA}.patch
script:
- ./scripts/ci/run_benches_for_runtime.sh $RUNTIME
- git diff -P > ${RUNTIME}_weights_${CI_COMMIT_SHORT_SHA}.patch
# uses the "shell" executors
tags:
- weights
update_kusama_weights:
<<: *update-weights
variables:
RUNTIME: kusama
update_westend_weights:
<<: *update-weights
variables:
RUNTIME: westend
update_rococo_weights:
<<: *update-weights
variables:
RUNTIME: rococo
#### stage: stage3
build-rustdoc:
stage: stage3
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: test-deterministic-wasm
artifacts: false
<<: *docker-env
<<: *test-refs
variables:
SKIP_WASM_BUILD: 1
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}-doc"
when: on_success
expire_in: 1 days
paths:
- ./crate-docs/
script:
# FIXME: it fails with `RUSTDOCFLAGS="-Dwarnings"` and `--all-features`
# FIXME: return to stable when https://github.com/rust-lang/rust/issues/96937 gets into stable
- time cargo +nightly doc --workspace --verbose --no-deps
- rm -f ./target/doc/.lock
- mv ./target/doc ./crate-docs
# FIXME: remove me after CI image gets nonroot
- chown -R nonroot:nonroot ./crate-docs
- echo "<meta http-equiv=refresh content=0;url=polkadot_service/index.html>" > ./crate-docs/index.html
build-implementers-guide:
stage: stage3
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: test-deterministic-wasm
artifacts: false
<<: *test-refs
<<: *docker-env
<<: *collect-artifacts-short
script:
- cargo install mdbook mdbook-mermaid mdbook-linkcheck
- mdbook build ./roadmap/implementers-guide
- mkdir -p artifacts
- mv roadmap/implementers-guide/book artifacts/
# FIXME: remove me after CI image gets nonroot
- chown -R nonroot:nonroot artifacts/
check-try-runtime:
stage: stage3
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: test-node-metrics
artifacts: false
<<: *test-refs
<<: *docker-env
<<: *compiler-info
script:
# Check that everything compiles with `try-runtime` feature flag.
- cargo check --features try-runtime --all
# More info can be found here: https://github.com/paritytech/polkadot/pull/5865
# Works only in PRs
check-runtime-migration:
stage: stage3
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: test-node-metrics
artifacts: false
<<: *test-pr-refs
<<: *docker-env
<<: *compiler-info
script:
- |
export has_runtimemigration_label=$(curl -sS -H "Accept: application/vnd.github+json" \
-H "Authorization: token $GITHUB_PR_TOKEN" \
https://api.github.com/repos/paritytech/polkadot/issues/$CI_COMMIT_REF_NAME/labels | grep "E1" | wc -l)
- |
if [[ $has_runtimemigration_label != 0 ]]; then
echo "Found label runtimemigration. Running tests"
export RUST_LOG=remote-ext=debug,runtime=debug
time cargo test --release -p westend-runtime -p polkadot-runtime -p kusama-runtime --features try-runtime
else
echo "runtimemigration label not found. Skipping"
fi
allow_failure: true
check-no-default-features:
stage: stage3
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: test-deterministic-wasm
artifacts: false
<<: *test-refs
<<: *docker-env
<<: *compiler-info
script:
# Check that polkadot-cli will compile no default features.
- pushd ./node/service && cargo check --no-default-features && popd
- pushd ./cli && cargo check --no-default-features --features "service" && popd
- sccache -s
build-short-benchmark:
stage: stage3
<<: *test-refs
<<: *docker-env
<<: *collect-artifacts
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: test-node-metrics
artifacts: false
script:
- cargo +nightly build --profile release --locked --features=runtime-benchmarks
- mkdir artifacts
- cp ./target/release/polkadot ./artifacts/
deploy-parity-testnet:
stage: stage3
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: test-deterministic-wasm
artifacts: false
<<: *deploy-testnet-refs
variables:
POLKADOT_CI_COMMIT_NAME: "${CI_COMMIT_REF_NAME}"
POLKADOT_CI_COMMIT_REF: "${CI_COMMIT_SHORT_SHA}"
allow_failure: false
trigger: "parity/infrastructure/parity-testnet"
zombienet-tests-parachains-smoke-test:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-malus-image
- job: publish-test-collators-image
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/smoke"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG}
- export COL_IMAGE="docker.io/paritypr/colander:4519" # The collator image is fixed
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0001-parachains-smoke-test.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-tests-parachains-pvf:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-test-collators-image
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG}
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0001-parachains-pvf.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-tests-parachains-disputes:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-test-collators-image
- job: publish-malus-image
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG}
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0002-parachains-disputes.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-tests-parachains-disputes-garbage-candidate:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-test-collators-image
- job: publish-malus-image
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG}
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0003-parachains-garbage-candidate.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-test-parachains-upgrade-smoke-test:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-malus-image
- job: publish-test-collators-image
variables:
GH_DIR: 'https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/smoke'
before_script:
- echo "ZombieNet Tests Config"
- echo "${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}"
- echo "docker.io/parity/polkadot-collator:latest"
- echo "${ZOMBIENET_IMAGE}"
- echo "${GH_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export COL_IMAGE="docker.io/parity/polkadot-collator:latest" # Use cumulus lastest image
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0002-parachains-upgrade-smoke-test.feature"
allow_failure: true
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-tests-misc-paritydb:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-test-collators-image
artifacts: true
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/misc"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie,zombie::network-node
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0001-paritydb.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-tests-misc-upgrade-node:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-test-collators-image
- job: build-linux-stable
artifacts: true
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/misc"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie,zombie::network-node
- BUILD_RELEASE_VERSION="$(cat ./artifacts/BUILD_RELEASE_VERSION)"
- export ZOMBIENET_INTEGRATION_TEST_IMAGE="docker.io/parity/polkadot:${BUILD_RELEASE_VERSION}"
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
- BUILD_LINUX_JOB_ID="$(cat ./artifacts/BUILD_LINUX_JOB_ID)"
- export POLKADOT_PR_BIN_URL="https://gitlab.parity.io/parity/mirrors/polkadot/-/jobs/${BUILD_LINUX_JOB_ID}/artifacts/raw/artifacts/polkadot"
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0002-upgrade-node.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-tests-malus-dispute-valid:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
- job: publish-malus-image
- job: publish-test-collators-image
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/node/malus/integrationtests"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${MALUS_IMAGE_NAME} ${MALUS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG}
- export COL_IMAGE=${COLLATOR_IMAGE_NAME}:${COLLATOR_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0001-dispute-valid-block.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-tests-deregister-register-validator:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
artifacts: true
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/smoke"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
- export MALUS_IMAGE=${MALUS_IMAGE_NAME}:${MALUS_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0003-deregister-register-validator-smoke.feature"
allow_failure: false
retry: 2
tags:
- zombienet-polkadot-integration-test
zombienet-tests-beefy-and-mmr:
stage: stage3
image: "${ZOMBIENET_IMAGE}"
<<: *kubernetes-env
<<: *zombienet-refs
needs:
- job: publish-polkadot-debug-image
variables:
GH_DIR: "https://github.com/paritytech/polkadot/tree/${CI_COMMIT_SHORT_SHA}/zombienet_tests/functional"
before_script:
- echo "Zombie-net Tests Config"
- echo "${ZOMBIENET_IMAGE_NAME}"
- echo "${PARACHAINS_IMAGE_NAME} ${PARACHAINS_IMAGE_TAG}"
- echo "${GH_DIR}"
- export DEBUG=zombie*
- export ZOMBIENET_INTEGRATION_TEST_IMAGE=${PARACHAINS_IMAGE_NAME}:${PARACHAINS_IMAGE_TAG}
script:
- /home/nonroot/zombie-net/scripts/ci/run-test-env-manager.sh
--github-remote-dir="${GH_DIR}"
--test="0003-beefy-and-mmr.feature"
allow_failure: true
retry: 2
tags:
- zombienet-polkadot-integration-test
#### stage: stage4
publish-rustdoc:
stage: stage4
<<: *kubernetes-env
image: paritytech/tools:latest
variables:
GIT_DEPTH: 100
rules:
- if: $CI_PIPELINE_SOURCE == "pipeline"
when: never
- if: $CI_PIPELINE_SOURCE == "web" && $CI_COMMIT_REF_NAME == "master"