Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit b925c41

Browse files
committed
Merge remote-tracking branch 'origin/master' into gav-nis-reserve
2 parents 2d143b9 + 2893730 commit b925c41

File tree

470 files changed

+28141
-10317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

470 files changed

+28141
-10317
lines changed

.gitlab-ci.yml

Lines changed: 82 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,39 @@ variables:
4848
CARGO_INCREMENTAL: 0
4949
DOCKER_OS: "debian:stretch"
5050
ARCH: "x86_64"
51-
# staging image with rust 1.65 and nightly-2022-11-16
52-
CI_IMAGE: "paritytech/ci-linux@sha256:786869e731963b3cc0a4aa9deb83367ed9e87a6ae48b6eb029d62b0cab4d87c1"
51+
CI_IMAGE: "paritytech/ci-linux:production"
5352
BUILDAH_IMAGE: "quay.io/buildah/stable:v1.27"
5453
RUSTY_CACHIER_SINGLE_BRANCH: master
5554
RUSTY_CACHIER_DONT_OPERATE_ON_MAIN_BRANCH: "true"
55+
RUSTY_CACHIER_COMPRESSION_METHOD: zstd
56+
NEXTEST_FAILURE_OUTPUT: immediate-final
57+
NEXTEST_SUCCESS_OUTPUT: final
5658
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.22"
5759

58-
default:
60+
.shared-default: &shared-default
5961
retry:
6062
max: 2
6163
when:
6264
- runner_system_failure
6365
- unknown_failure
6466
- api_failure
65-
interruptible: true
6667
cache: {}
6768

69+
.default-pipeline-definitions:
70+
default:
71+
<<: *shared-default
72+
interruptible: true
73+
74+
.crate-publishing-pipeline-definitions:
75+
default:
76+
<<: *shared-default
77+
# The crate-publishing pipeline defaults to `interruptible: false` so that we'll be able to
78+
# reach and run the publishing jobs despite the "Auto-cancel redundant pipelines" CI setting.
79+
# The setting is relevant because the crate-publishing pipeline runs on `master`, thus future
80+
# pipelines on `master` (e.g. created for new commits or other schedules) might unintendedly
81+
# cancel the publishing jobs or its dependencies before we get to actually publish the crates.
82+
interruptible: false
83+
6884
.collect-artifacts:
6985
artifacts:
7086
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
@@ -81,8 +97,24 @@ default:
8197
paths:
8298
- artifacts/
8399

100+
.prepare-env:
101+
before_script:
102+
# TODO: remove unset invocation when we'll be free from 'ENV RUSTC_WRAPPER=sccache' & sccache
103+
# itself in all images
104+
- unset RUSTC_WRAPPER
105+
# $WASM_BUILD_WORKSPACE_HINT enables wasm-builder to find the Cargo.lock from within generated
106+
# packages
107+
- export WASM_BUILD_WORKSPACE_HINT="$PWD"
108+
109+
.job-switcher:
110+
before_script:
111+
- if echo "$CI_DISABLED_JOBS" | grep -xF "$CI_JOB_NAME"; then echo "The job has been cancelled in CI settings"; exit 0; fi
112+
84113
.kubernetes-env:
85114
image: "${CI_IMAGE}"
115+
before_script:
116+
- !reference [.job-switcher, before_script]
117+
- !reference [.prepare-env, before_script]
86118
tags:
87119
- kubernetes-parity-build
88120

@@ -95,6 +127,7 @@ default:
95127

96128
.pipeline-stopper-vars:
97129
script:
130+
- !reference [.job-switcher, before_script]
98131
- echo "Collecting env variables for the cancel-pipeline job"
99132
- echo "FAILED_JOB_URL=${CI_JOB_URL}" > pipeline-stopper.env
100133
- echo "FAILED_JOB_NAME=${CI_JOB_NAME}" >> pipeline-stopper.env
@@ -108,8 +141,8 @@ default:
108141
.docker-env:
109142
image: "${CI_IMAGE}"
110143
before_script:
111-
# TODO: remove unset invocation when we'll be free from 'ENV RUSTC_WRAPPER=sccache' & sccache itself in all images
112-
- unset RUSTC_WRAPPER
144+
- !reference [.job-switcher, before_script]
145+
- !reference [.prepare-env, before_script]
113146
- !reference [.rust-info-script, script]
114147
- !reference [.rusty-cachier, before_script]
115148
- !reference [.pipeline-stopper-vars, script]
@@ -196,9 +229,21 @@ default:
196229
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
197230
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"
198231

232+
.crates-publishing-variables:
233+
variables:
234+
CRATESIO_CRATES_OWNER: parity-crate-owner
235+
REPO: substrate
236+
REPO_OWNER: paritytech
237+
238+
.crates-publishing-pipeline:
239+
extends: .crates-publishing-variables
240+
rules:
241+
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_REF_NAME == "master" && $PIPELINE == "automatic-crate-publishing"
242+
199243
.crates-publishing-template:
200-
stage: test
201-
extends: .docker-env
244+
extends:
245+
- .docker-env
246+
- .crates-publishing-variables
202247
# collect artifacts even on failure so that we know how the crates were generated (they'll be
203248
# generated to the artifacts folder according to SPUB_TMP further down)
204249
artifacts:
@@ -208,12 +253,7 @@ default:
208253
paths:
209254
- artifacts/
210255
variables:
211-
CRATESIO_API: https://crates.io/api
212-
CRATESIO_CRATES_OWNER: parity-crate-owner
213-
GH_API: https://api.github.com
214-
REPO: substrate
215-
REPO_OWNER: paritytech
216-
SPUB_TMP: artifacts
256+
SPUB_TMP: artifacts
217257

218258
#### stage: .pre
219259

@@ -231,6 +271,18 @@ skip-if-draft:
231271
- ./scripts/ci/gitlab/skip_if_draft.sh
232272
allow_failure: true
233273

274+
check-crates-publishing-pipeline:
275+
stage: .pre
276+
extends:
277+
- .kubernetes-env
278+
- .crates-publishing-pipeline
279+
script:
280+
- git clone
281+
--depth 1
282+
--branch "$RELENG_SCRIPTS_BRANCH"
283+
https://github.com/paritytech/releng-scripts.git
284+
- ONLY_CHECK_PIPELINE=true ./releng-scripts/publish-crates
285+
234286
include:
235287
# check jobs
236288
- scripts/ci/gitlab/pipeline/check.yml
@@ -242,6 +294,22 @@ include:
242294
- scripts/ci/gitlab/pipeline/publish.yml
243295
# zombienet jobs
244296
- scripts/ci/gitlab/pipeline/zombienet.yml
297+
# The crate-publishing pipeline requires a customized `interruptible` configuration. Unfortunately
298+
# `interruptible` can't currently be dynamically set based on variables as per:
299+
# - https://gitlab.com/gitlab-org/gitlab/-/issues/38349
300+
# - https://gitlab.com/gitlab-org/gitlab/-/issues/194023
301+
# Thus we work around that limitation by using conditional includes.
302+
# For crate-publishing pipelines: run it with defaults + `interruptible: false`. The WHOLE
303+
# pipeline is made uninterruptible to ensure that test jobs also get a chance to run to
304+
# completion, because the publishing jobs depends on them AS INTENDED: crates should not be
305+
# published before their source code is checked.
306+
- local: scripts/ci/gitlab/crate-publishing-pipeline.yml
307+
rules:
308+
- if: $PIPELINE == "automatic-crate-publishing"
309+
# For normal pipelines: run it with defaults + `interruptible: true`
310+
- local: scripts/ci/gitlab/default-pipeline.yml
311+
rules:
312+
- if: $PIPELINE != "automatic-crate-publishing"
245313

246314
#### stage: deploy
247315

@@ -300,7 +368,6 @@ rusty-cachier-notify:
300368
PR_NUM: "${PR_NUM}"
301369
trigger:
302370
project: "parity/infrastructure/ci_cd/pipeline-stopper"
303-
branch: "as-improve"
304371

305372
remove-cancel-pipeline-message:
306373
stage: .post

0 commit comments

Comments
 (0)