From d4151f2efd09254dc8f45dca761f0f83af93d97d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 3 Dec 2020 18:25:54 +0100 Subject: [PATCH] ci: Run sanity job only in pre-merge pipelines It's more of a nuisance than useful for forked branches. This means the test-docs job can no longer have a direct dependency on sanity for forked branches, so split it up into two jobs: one for pre-merge pipelines, one for forked branches. Part-of: --- .gitlab-ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 23f1f86083b..f4b32485cdd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -101,13 +101,24 @@ test-docs: # Cancel job if a newer commit is pushed to the same branch interruptible: true stage: deploy + needs: [] + rules: + - *ignore_scheduled_pipelines + - if: *is-forked-branch + changes: *docs-or-ci + when: manual + # Other cases default to never + +test-docs-mr: + extends: + - test-docs needs: - sanity rules: - if: *is-pre-merge-for-marge changes: *docs-or-ci when: on_success - - if: *is-forked-branch-or-pre-merge + - if: *is-pre-merge changes: *docs-or-ci when: manual # Other cases default to never @@ -496,8 +507,6 @@ sanity: GIT_STRATEGY: none script: # ci-fairy check-commits --junit-xml=check-commits.xml - # ci-fairy check-merge-request only works in pre-merge pipelines for MRs - - if test "x$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" != "x$CI_COMMIT_REF_NAME"; then exit 0; fi - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml artifacts: when: on_failure