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

Commit e63e269

Browse files
authored
[ci] Adjust job order in pipeline test stage with Gitlab DAG (#11442)
* [Do Not Merge] Test gitlab DAG in pipeline * add jobs for pipeline cancel * add check-tracing to cancel-pipeline
1 parent d45e383 commit e63e269

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed

.gitlab-ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,29 @@ deploy-prometheus-alerting-rules:
201201
changes:
202202
- .gitlab-ci.yml
203203
- ./scripts/ci/monitoring/**/*
204+
205+
#### stage: .post
206+
207+
# This job cancels the whole pipeline if any of provided jobs fail.
208+
# In a DAG, every jobs chain is executed independently of others. The `fail_fast` principle suggests
209+
# to fail the pipeline as soon as possible to shorten the feedback loop.
210+
cancel-pipeline:
211+
stage: .post
212+
needs:
213+
- job: test-linux-stable
214+
artifacts: false
215+
- job: test-linux-stable-int
216+
artifacts: false
217+
- job: cargo-check-subkey
218+
artifacts: false
219+
- job: cargo-check-benches
220+
artifacts: false
221+
- job: check-tracing
222+
artifacts: false
223+
rules:
224+
- if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs
225+
when: on_failure
226+
variables:
227+
PROJECT_ID: "${CI_PROJECT_ID}"
228+
PIPELINE_ID: "${CI_PIPELINE_ID}"
229+
trigger: "parity/infrastructure/ci_cd/pipeline-stopper"

scripts/ci/gitlab/pipeline/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ cargo-fmt:
3030

3131
cargo-clippy:
3232
stage: test
33+
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
34+
needs:
35+
- job: cargo-fmt
36+
artifacts: false
3337
extends:
3438
- .docker-env
3539
- .test-refs
@@ -38,6 +42,10 @@ cargo-clippy:
3842

3943
cargo-check-nixos:
4044
stage: test
45+
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
46+
needs:
47+
- job: cargo-clippy
48+
artifacts: false
4149
extends:
4250
- .docker-env
4351
- .test-refs
@@ -117,6 +125,10 @@ cargo-check-subkey:
117125

118126
cargo-check-try-runtime:
119127
stage: test
128+
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
129+
needs:
130+
- job: cargo-check-subkey
131+
artifacts: false
120132
extends:
121133
- .docker-env
122134
- .test-refs
@@ -125,6 +137,10 @@ cargo-check-try-runtime:
125137

126138
cargo-check-wasmer-sandbox:
127139
stage: test
140+
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
141+
needs:
142+
- job: cargo-check-try-runtime
143+
artifacts: false
128144
extends:
129145
- .docker-env
130146
- .test-refs
@@ -133,6 +149,10 @@ cargo-check-wasmer-sandbox:
133149

134150
test-deterministic-wasm:
135151
stage: test
152+
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
153+
needs:
154+
- job: cargo-check-wasmer-sandbox
155+
artifacts: false
136156
extends:
137157
- .docker-env
138158
- .test-refs
@@ -217,6 +237,10 @@ test-linux-stable-int:
217237

218238
check-tracing:
219239
stage: test
240+
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
241+
needs:
242+
- job: test-linux-stable-int
243+
artifacts: false
220244
extends:
221245
- .docker-env
222246
- .test-refs
@@ -227,6 +251,10 @@ check-tracing:
227251

228252
test-full-crypto-feature:
229253
stage: test
254+
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
255+
needs:
256+
- job: check-tracing
257+
artifacts: false
230258
extends:
231259
- .docker-env
232260
- .test-refs

0 commit comments

Comments
 (0)