Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
432091b
avoid unintentionally canceling the scheduled crate publishing job
joao-paulo-parity Jan 6, 2023
533e1ff
check manual pipelines by $CI_PIPELINE_SOURCE instead of $CI_JOB_MANUAL
joao-paulo-parity Jan 6, 2023
ae6493f
make crate-publishing pipelines uninterruptible
joao-paulo-parity Jan 6, 2023
a7a522c
use conditional includes to work around interruptible limitations
joao-paulo-parity Jan 6, 2023
70ef904
organize comments
joao-paulo-parity Jan 6, 2023
f16de79
remove interruptible from common pipeline
joao-paulo-parity Jan 6, 2023
8d5ea86
wip: check include
joao-paulo-parity Jan 6, 2023
370b140
wip: check include
joao-paulo-parity Jan 6, 2023
0bc5958
fix include
joao-paulo-parity Jan 6, 2023
618c509
fix include
joao-paulo-parity Jan 6, 2023
6e4421f
fix include
joao-paulo-parity Jan 6, 2023
716fa11
fix yaml
joao-paulo-parity Jan 6, 2023
261d47c
fix yaml
joao-paulo-parity Jan 6, 2023
6ef0120
remove shared common-pipeline
joao-paulo-parity Jan 6, 2023
7553643
wip: retry common-pipeline
joao-paulo-parity Jan 6, 2023
211c9ef
move .default-template to .gitlab-ci.yml
joao-paulo-parity Jan 6, 2023
e791c05
fix the pipeline
joao-paulo-parity Jan 6, 2023
74d128e
fix default-pipeline.yml
joao-paulo-parity Jan 6, 2023
2a68e42
revert publish-crates-manual to when: manual
joao-paulo-parity Jan 6, 2023
cf20d13
move "needs:" back to publish-crates
joao-paulo-parity Jan 6, 2023
c57cb15
Merge branch 'master' of github.com:paritytech/substrate into fix
joao-paulo-parity Jan 9, 2023
56a3a73
avoid manual repetition
joao-paulo-parity Jan 9, 2023
aff91c5
improve previous commit
joao-paulo-parity Jan 9, 2023
0dac70d
try to avoid manual repetition
joao-paulo-parity Jan 9, 2023
9c02881
fix indentation
joao-paulo-parity Jan 9, 2023
294c092
minor adjustments
joao-paulo-parity Jan 9, 2023
c5952d6
move defaults to top of .gitlab-ci.yml
joao-paulo-parity Jan 9, 2023
3f2909a
fix positioning on default in the diff
joao-paulo-parity Jan 9, 2023
479da91
comments
joao-paulo-parity Jan 10, 2023
08d899d
indentation
joao-paulo-parity Jan 10, 2023
c969998
Apply suggestions from code review
joao-paulo-parity Jan 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,30 @@ variables:
RUSTY_CACHIER_COMPRESSION_METHOD: zstd
ZOMBIENET_IMAGE: "docker.io/paritytech/zombienet:v1.3.22"

default:
.shared-default: &shared-default
retry:
max: 2
when:
- runner_system_failure
- unknown_failure
- api_failure
interruptible: true
cache: {}

.default-pipeline-definitions:
default:
<<: *shared-default
interruptible: true

.crate-publishing-pipeline-definitions:
default:
<<: *shared-default
# The crate-publishing pipeline defaults to `interruptible: false` so that we'll be able to
# reach and run the publishing jobs despite the "Auto-cancel redundant pipelines" CI setting.
# The setting is relevant because the crate-publishing pipeline runs on `master`, thus future
# pipelines on `master` (e.g. created for new commits or other schedules) might unintendedly
# cancel the publishing jobs or its dependencies before we get to actually publish the crates.
interruptible: false

.collect-artifacts:
artifacts:
name: "${CI_JOB_NAME}_${CI_COMMIT_REF_NAME}"
Expand Down Expand Up @@ -213,9 +227,15 @@ default:
# this job runs only on nightly pipeline with the mentioned variable, against `master` branch
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "nightly"

.crate-publishing-pipeline:
rules:
- if: $CI_COMMIT_REF_NAME != "master"
when: never

.scheduled-crate-publishing-pipeline:
rules:
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "automatic-crate-publishing"
- !reference [.crate-publishing-pipeline, rules]
- if: $CI_PIPELINE_SOURCE == "schedule" && $PIPELINE == "automatic-crate-publishing"

.crates-publishing-template:
stage: test
Expand Down Expand Up @@ -263,6 +283,22 @@ include:
- scripts/ci/gitlab/pipeline/publish.yml
# zombienet jobs
- scripts/ci/gitlab/pipeline/zombienet.yml
# The crate-publishing pipeline requires a customized `interruptible` configuration. Unfortunately
# `interruptible` can't currently be dynamically set based on variables as per:
# - https://gitlab.com/gitlab-org/gitlab/-/issues/38349
# - https://gitlab.com/gitlab-org/gitlab/-/issues/194023
# Thus we work around that limitation by using conditional includes.
# For crate-publishing pipelines: run it with defaults + `interruptible: false`. The WHOLE
# pipeline is made uninterruptible to ensure that test jobs also get a chance to run to
# completion, because the publishing jobs depends on them AS INTENDED: crates should not be
# published before their source code is checked.
- local: scripts/ci/gitlab/crate-publishing-pipeline.yml
rules:
- if: $PIPELINE == "automatic-crate-publishing"
# For normal pipelines: run it with defaults + `interruptible: true`
- local: scripts/ci/gitlab/default-pipeline.yml
rules:
- if: $PIPELINE != "automatic-crate-publishing"

#### stage: deploy

Expand Down
1 change: 1 addition & 0 deletions scripts/ci/gitlab/crate-publishing-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default: !reference [.crate-publishing-pipeline-definitions, default]
1 change: 1 addition & 0 deletions scripts/ci/gitlab/default-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default: !reference [.default-pipeline-definitions, default]
3 changes: 2 additions & 1 deletion scripts/ci/gitlab/pipeline/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ update-node-template:
timeout: 9h
# A custom publishing environment is used for us to be able to set up protected secrets
# specifically for it
environment: publish-crates
environment: publish-crates
script:
- rusty-cachier snapshot create
- git clone
Expand All @@ -234,5 +234,6 @@ publish-crates:

publish-crates-manual:
extends: .publish-crates-template
rules: !reference [.crate-publishing-pipeline, rules]
when: manual
allow_failure: true