From 98ffe5e885b0d06ce93db9c60b552d8dee857753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <3397065-ZehMatt@users.noreply.gitlab.com> Date: Fri, 9 Sep 2022 18:10:56 +0300 Subject: [PATCH 1/2] Only run one pipeline for merge requests --- .gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 54c9251880..24203a25e6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,14 @@ default: interruptible: true + +# Merge requests have two pipelines, filter pipelines using branch and merge request event together. +# See https://docs.gitlab.com/ee/ci/pipelines/merge_request_pipelines.html#two-pipelines-when-pushing-to-a-branch +workflow: + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS + when: never + - if: $CI_COMMIT_BRANCH # Note: We set `needs` on each job to control the job DAG. # See https://docs.gitlab.com/ee/ci/yaml/#needs From 2dde5983266efa0befdd8052f3a5f9a975f11dc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <3397065-ZehMatt@users.noreply.gitlab.com> Date: Fri, 9 Sep 2022 18:20:00 +0300 Subject: [PATCH 2/2] Adjust rules and remove them from templates --- .gitlab-ci.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 24203a25e6..bd58217b33 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -29,8 +29,6 @@ variables: - docker - linux image: ubuntu:22.04 - rules: - - if: $CI_PIPELINE_SOURCE == "push" .Ubuntu: extends: .Ubuntu_Image @@ -397,8 +395,6 @@ macOS12_Xcode13: .Windows_Ninja_Base: tags: - windows - rules: - - if: $CI_PIPELINE_SOURCE == "push" before_script: - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - choco source add -n=openmw-proxy -s="https://repo.openmw.org/repository/Chocolatey/" --priority=1 @@ -500,8 +496,6 @@ macOS12_Xcode13: .Windows_MSBuild_Base: tags: - windows - rules: - - if: $CI_PIPELINE_SOURCE == "push" before_script: - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - choco source add -n=openmw-proxy -s="https://repo.openmw.org/repository/Chocolatey/" --priority=1 @@ -599,9 +593,9 @@ Windows_MSBuild_RelWithDebInfo: rules: # run this for both pushes and schedules so 'latest successful pipeline for branch' always includes it - if: $CI_PIPELINE_SOURCE == "push" + - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_PIPELINE_SOURCE == "schedule" - .Ubuntu_AndroidNDK_arm64-v8a: tags: - linux