Mesa (master): gitlab-ci: Don't require triggering build/test jobs manually

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 7 18:00:13 UTC 2020


Module: Mesa
Branch: master
Commit: 42fe600c0c27f2605fa616af4ffce157598d7253
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=42fe600c0c27f2605fa616af4ffce157598d7253

Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Fri Apr  3 12:50:11 2020 +0200

gitlab-ci: Don't require triggering build/test jobs manually

Let them run automatically once all their dependencies have passed.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4432>

---

 .gitlab-ci.yml | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 8623731960b..dcdb06a2a5a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,9 +25,9 @@ stages:
 # When to automatically run the CI
 .ci-run-policy:
   rules:
-    # Run pipeline by default for merge requests changing files affecting it
-    - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
-      changes: &all_paths
+    # If any files affecting the pipeline are changed, build/test jobs run
+    # automatically once all dependency jobs have passed
+    - changes: &all_paths
       - VERSION
       - bin/**/*
       # GitLab CI
@@ -45,16 +45,7 @@ stages:
       - include/**/*
       - src/**/*
       when: on_success
-    # Run pipeline by default in the main project if files affecting it were
-    # changed
-    - if: '$CI_PROJECT_PATH == "mesa/mesa"'
-      changes:
-        *all_paths
-      when: on_success
-    # Allow triggering jobs manually on branches of forked projects
-    - if: '$CI_PROJECT_PATH != "mesa/mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
-      when: manual
-    # Otherwise, most jobs won't run
+    # Otherwise, build/test jobs won't run
     - when: never
   retry:
     max: 2
@@ -108,6 +99,26 @@ success:
   stage: container
   extends:
     - .ci-run-policy
+  rules:
+    # Run pipeline by default if it is for a merge request and any files
+    # affecting it were changed
+    - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME == $CI_COMMIT_REF_NAME'
+      changes:
+        *all_paths
+      when: on_success
+    # Run pipeline by default in the main project if any files affecting it were
+    # changed
+    - if: '$CI_PROJECT_PATH == "mesa/mesa"'
+      changes:
+        *all_paths
+      when: on_success
+    # Allow triggering jobs manually for branches of forked projects
+    - if: '$CI_PROJECT_PATH != "mesa/mesa" && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != $CI_COMMIT_REF_NAME'
+      changes:
+        *all_paths
+      when: manual
+    # Otherwise, container jobs won't run
+    - when: never
   variables:
     FDO_DISTRIBUTION_VERSION: buster-slim
     FDO_REPO_SUFFIX: "debian/$CI_JOB_NAME"



More information about the mesa-commit mailing list