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

Commit

Permalink
[ci] Improve cancel-pipeline job (#5874)
Browse files Browse the repository at this point in the history
* [ci] test-linux-stable and cancel-pipelines improvements

* fail check-try-runtime

* import changes from master

* fix needs

* fix check-try-runtime

* remove cancel pipeline from check-try-runtime

* return before_script to check-try-runtime
  • Loading branch information
alvicsam authored Aug 15, 2022
1 parent 8772d99 commit 5ab0bea
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ default:
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
Expand Down Expand Up @@ -223,8 +236,12 @@ build-linux-stable:
test-linux-stable:
stage: stage1
<<: *docker-env
<<: *compiler-info
<<: *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
Expand Down Expand Up @@ -606,7 +623,6 @@ check-try-runtime:
script:
# Check that everything compiles with `try-runtime` feature flag.
- cargo check --features try-runtime --all
- sccache -s

check-no-default-features:
stage: stage3
Expand Down Expand Up @@ -1005,17 +1021,18 @@ short-benchmark-westend:
when: on_failure
variables:
PROJECT_ID: "${CI_PROJECT_ID}"
PROJECT_NAME: "${CI_PROJECT_NAME}"
PIPELINE_ID: "${CI_PIPELINE_ID}"
trigger: "parity/infrastructure/ci_cd/pipeline-stopper"
FAILED_JOB_URL: "${FAILED_JOB_URL}"
FAILED_JOB_NAME: "${FAILED_JOB_NAME}"
PR_NUM: "${PR_NUM}"
trigger:
project: "parity/infrastructure/ci_cd/pipeline-stopper"
# remove branch, when pipeline-stopper for polakdot is updated to the same branch
branch: "as-improve"

cancel-pipeline-test-linux-stable:
extends: .cancel-pipeline-template
needs:
- job: test-linux-stable
artifacts: false

cancel-pipeline-check-try-runtime:
extends: .cancel-pipeline-template
needs:
- job: check-try-runtime
artifacts: false

0 comments on commit 5ab0bea

Please sign in to comment.