From 2e57783c9f0e02aeb110d8176c39589ca0d15a31 Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 9 Sep 2021 06:13:56 +0300 Subject: [PATCH] ci: avoid spawning 2 pipelines for each commit When an MR is open, you can have both a normal and a "detached" pipeline. They have different properties, but a detached pipeline is enough for us and identical to the normal one, so we can avoid the extra load on the CI. https://docs.gitlab.com/ee/ci/jobs/job_control.html#avoid-duplicate-pipelines https://docs.gitlab.com/ee/ci/yaml/index.html#switch-between-branch-pipelines-and-merge-request-pipelines --- .gitlab-ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a1b6b3dfc..18a08ce7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,6 +26,16 @@ include: - local: "ci/images_template.yml" +workflow: + rules: + - if: $CI_MERGE_REQUEST_IID + # don't create a pipeline if its a commit pipeline, on a branch and that branch has + # open merge requests (bc we will get a MR build instead) + - if: $CI_OPEN_MERGE_REQUESTS + when: never + - if: $CI_COMMIT_TAG + - if: $CI_COMMIT_BRANCH + variables: FDO_UPSTREAM_REPO: gstreamer/gstreamer-rs RUST_DOCS_FLAGS: "--extern-html-root-url=muldiv=https://docs.rs/muldiv/1.0.0/muldiv/ -Z unstable-options"