From fcc6bb819bbaa30a055948054c18c7399ae812ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Mon, 28 Jun 2021 21:22:59 +0200 Subject: [PATCH] make sure that all CI jobs run always and not only in branch --- .gitlab/CI/build.gitlab-ci.yml | 4 ++-- .gitlab/CI/publish.gitlab-ci.yml | 2 +- .gitlab/CI/recompile.yml | 24 ++++-------------------- .gitlab/CI/release.yml | 6 +++--- 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/.gitlab/CI/build.gitlab-ci.yml b/.gitlab/CI/build.gitlab-ci.yml index d5c0fb21a6..3fdbd8fe45 100644 --- a/.gitlab/CI/build.gitlab-ci.yml +++ b/.gitlab/CI/build.gitlab-ci.yml @@ -15,7 +15,7 @@ unittests: max: 2 benchmarks: - extends: .post-merge + extends: .release stage: build image: registry.gitlab.com/veloren/veloren-docker-ci/cache/bench:${CACHE_IMAGE_TAG} tags: @@ -43,7 +43,7 @@ benchmarks: # Coverage is needed on master for the README.md badge to work # tmp remove simd as it doesnt work with tarpaulin: https://github.com/rust-lang/rust/issues/77529 coverage: - extends: .post-merge + extends: .release stage: build image: registry.gitlab.com/veloren/veloren-docker-ci/cache/tarpaulin:${CACHE_IMAGE_TAG} script: diff --git a/.gitlab/CI/publish.gitlab-ci.yml b/.gitlab/CI/publish.gitlab-ci.yml index 89888c602a..e08ffc2608 100644 --- a/.gitlab/CI/publish.gitlab-ci.yml +++ b/.gitlab/CI/publish.gitlab-ci.yml @@ -10,7 +10,7 @@ .publish-nightly: stage: publish rules: - - if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "schedule" when: always - when: never diff --git a/.gitlab/CI/recompile.yml b/.gitlab/CI/recompile.yml index bc4579e191..c366dfe40a 100644 --- a/.gitlab/CI/recompile.yml +++ b/.gitlab/CI/recompile.yml @@ -1,36 +1,20 @@ # Template to only run if actual changes has been made to the code and not just documentation .recompile-branch: rules: - - if: $CI_COMMIT_REF_NAME !~ /^master$/ + - if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH # No '-' here is *very* important: https://docs.gitlab.com/ee/ci/yaml/#complex-rule-clauses changes: - - "**/*.{glsl,rs,ron,toml,vox,png}" + - "**/*.{glsl,png,rs,ron,toml,vox,yml,wav}" - "rust-toolchain" - "Cargo.lock" - ".gitlab-ci.yml" - - "**/*.yml" # TODO: appears unused # like .recompile-branch but will run on master too .recompile: rules: - changes: - - "**/*.{glsl,rs,ron,toml,vox,png,wav}" + - "**/*.{glsl,png,rs,ron,toml,vox,yml,wav}" - "rust-toolchain" - "Cargo.lock" - - ".gitlab-ci.yml" - - "**/*.yml" - -# Template to only run these after a branch has merged to master -.post-merge: - stage: build - rules: - - if: $CI_PIPELINE_SOURCE == "schedule" - when: never - - if: $CI_COMMIT_REF_NAME =~ /^master$/ - changes: - - "**/*.{glsl,rs,ron,toml,vox,png}" - - "rust-toolchain" - - "Cargo.lock" - - ".gitlab-ci.yml" - - "**/*.yml" + - ".gitlab-ci.yml" \ No newline at end of file diff --git a/.gitlab/CI/release.yml b/.gitlab/CI/release.yml index 06556fa05c..68b2a10f7f 100644 --- a/.gitlab/CI/release.yml +++ b/.gitlab/CI/release.yml @@ -2,7 +2,7 @@ .optional-release: stage: check rules: - - if: $CI_COMMIT_REF_NAME =~ /^master$/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ || $CI_PIPELINE_SOURCE == "schedule" + - if: $CI_PIPELINE_SOURCE == "schedule" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/ when: never - when: manual allow_failure: true @@ -11,7 +11,7 @@ .release: stage: build rules: - - if: $CI_PIPELINE_SOURCE != "schedule" && ($CI_COMMIT_REF_NAME =~ /^master$/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/) + - if: $CI_PIPELINE_SOURCE != "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/) when: always - when: never @@ -19,6 +19,6 @@ .release-nightly-tmp-fix-airshipper: stage: build-nightly rules: - - if: $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_REF_NAME =~ /^master$/ || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/) + - if: $CI_PIPELINE_SOURCE == "schedule" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/ || $CI_COMMIT_REF_NAME =~ /^r[0-9]+\.[0-9]+/) when: always - when: never