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

[ci] Improve cancel-pipeline job #5874

Merged
merged 7 commits into from
Aug 15, 2022
Merged
Changes from all commits
Commits
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: 30 additions & 12 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 @@ -172,7 +185,8 @@ check-runtime:
stage: stage1
image: paritytech/tools:latest
<<: *kubernetes-env
<<: *test-refs
rules:
- if: $CI_COMMIT_REF_NAME =~ /^release-v[0-9]+\.[0-9]+.*$/ # i.e. release-v0.9.27
variables:
GITLAB_API: "https://gitlab.parity.io/api/v4"
GITHUB_API_PROJECT: "parity%2Finfrastructure%2Fgithub-api"
Expand Down Expand Up @@ -222,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 @@ -307,7 +325,7 @@ build-staking-miner:
stage: stage2
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: check-runtime
- job: cargo-fmt
artifacts: false
<<: *docker-env
<<: *test-pr-refs
Expand Down Expand Up @@ -336,7 +354,7 @@ test-node-metrics:
stage: stage2
# this is an artificial job dependency, for pipeline optimization using GitLab's DAGs
needs:
- job: check-runtime
- job: cargo-fmt
artifacts: false
<<: *docker-env
<<: *compiler-info
Expand Down Expand Up @@ -605,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 @@ -974,17 +991,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