summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <pwithnall@endlessos.org>2023-05-15 16:58:58 +0100
committerPhilip Withnall <pwithnall@endlessos.org>2023-05-15 18:05:10 +0100
commitb9b7816e5a16328ff32fa1cf3b87f9d69457a07c (patch)
treefb044f27f58c5a026905be3bb7a0bc8aa1a0b042
parent03aa8513f8591892fd5cc09b4fa068ba1bfc2667 (diff)
downloadglib-disable-post-merge-ci.tar.gz
ci: Don’t run pipeline after merging a MRdisable-post-merge-ci
MRs are already tested in CI before merge, so it’s redundant and a waste of resources to test them again after merge. In the rare case where something breaks post-merge (perhaps because several MRs have been tested individually and merged, but interact with each other badly), that’ll be caught in the weekly scheduled CI run. YAML inspiration from https://stackoverflow.com/questions/63893431/gitlab-run-a-pipeline-job-when-a-merge-request-is-merged Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
-rw-r--r--.gitlab-ci.yml9
1 files changed, 8 insertions, 1 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b05a7098f..8fece8e5d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -19,11 +19,18 @@ variables:
G_MESSAGES_DEBUG: all
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
+# Default CI job setup; contrast with `.only-origin`.
+#
+# Don’t execute the pipeline when a merge request is merged into `main`, as it
+# will have already been tested
.only-default:
only:
- branches
except:
- - tags
+ refs:
+ - tags
+ variables:
+ - $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# Some jobs run on CI runners which don’t have good isolation between CI jobs,
# and don’t have much available resource. Limit those jobs to only ones on the