ci: Don’t run pipeline after merging a MR

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>
This commit is contained in:
Philip Withnall 2023-05-15 16:58:58 +01:00
parent 03aa8513f8
commit b9b7816e5a

View File

@ -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`.
#
# Dont 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 dont have good isolation between CI jobs,
# and dont have much available resource. Limit those jobs to only ones on the