From 3a11be16830f6ac7d9a1cd8bf782198074c405b8 Mon Sep 17 00:00:00 2001 From: Alexander Samusev <41779041+alvicsam@users.noreply.github.com> Date: Thu, 10 Mar 2022 18:20:33 +0100 Subject: [PATCH] [ci] cancel pipeline if test-linux-stable fail (#5066) * [Do not merge] cancel pipeline if test-linux-stable fail * empty commit for pipeline rerun * fix test-linux-stable * fail test-linux-stable * empty commit for pipeline rerun * fix test-linux-stable * Update .gitlab-ci.yml Co-authored-by: Denis Pisarev * small fixes * add needs Co-authored-by: Denis Pisarev --- polkadot/.gitlab-ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/polkadot/.gitlab-ci.yml b/polkadot/.gitlab-ci.yml index 3f367fb8ff..6078874a04 100644 --- a/polkadot/.gitlab-ci.yml +++ b/polkadot/.gitlab-ci.yml @@ -803,3 +803,25 @@ publish-rustdoc: - echo "___Rustdoc was successfully published to https://paritytech.github.io/polkadot/___" after_script: - rm -rf .git/ ./* + +#### stage: .post + +# This job cancels the whole pipeline if any of provided jobs fail. +# In a DAG, every jobs chain is executed independently of others. The `fail_fast` principle suggests +# to fail the pipeline as soon as possible to shorten the feedback loop. +cancel-pipeline: + stage: .post + needs: + - job: test-linux-stable + artifacts: false + - job: check-runtime-benchmarks + artifacts: false + - job: check-try-runtime + artifacts: false + rules: + - if: $CI_COMMIT_REF_NAME =~ /^[0-9]+$/ # PRs + when: on_failure + variables: + PROJECT_ID: "${CI_PROJECT_ID}" + PIPELINE_ID: "${CI_PIPELINE_ID}" + trigger: "parity/infrastructure/ci_cd/pipeline-stopper"