Module: Mesa
Branch: main
Commit: 9618fefd189bfcd3e71bb1ae0a24f92706b9acd7
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9618fefd189bfcd3e71bb1ae0a24f92706b9acd7

Author: Eric Engestrom <[email protected]>
Date:   Tue Sep 19 14:09:10 2023 +0100

ci: unify container and build jobs rules

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25294>

---

 .gitlab-ci.yml                     | 78 ++++++++++++++------------------------
 .gitlab-ci/build/gitlab-ci.yml     |  2 +-
 .gitlab-ci/container/gitlab-ci.yml | 12 +++---
 docs/gitlab-ci.yml                 |  2 +-
 4 files changed, 37 insertions(+), 57 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 06ecbe8f384..5d86f2f6bbb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -153,61 +153,28 @@ include:
       when: on_success
 
 
-# When to automatically run the CI for build jobs
-.build-rules:
-  rules:
-    # Run when re-enabling a disabled farm, but not when disabling it
-    - !reference [.disable-farm-mr-rules, rules]
-    # If any files affecting the pipeline are changed, build/test jobs run
-    # automatically once all dependency jobs have passed
-    - changes: &all_paths
-      - VERSION
-      - bin/git_sha1_gen.py
-      - bin/install_megadrivers.py
-      - bin/symbols-check.py
-      # GitLab CI
-      - .gitlab-ci.yml
-      - .gitlab-ci/**/*
-      # Meson
-      - meson*
-      - build-support/**/*
-      - subprojects/**/*
-      # Source code
-      - include/**/*
-      - src/**/*
-      when: on_success
-    # Just skip everything for MRs which don't actually change anything in the
-    # build
-    - if: *is-pre-merge-for-marge
-      when: never
-    - if: *is-post-merge
-      when: never
-    # Always allow user branches etc to trigger jobs manually
-    - when: manual
-
-
-.ci-deqp-artifacts:
-  artifacts:
-    name: "mesa_${CI_JOB_NAME}"
-    when: always
-    untracked: false
-    paths:
-      # Watch out!  Artifacts are relative to the build dir.
-      # 
https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
-      - artifacts
-      - _build/meson-logs/*.txt
-      - _build/meson-logs/strace
-
-.container-rules:
+.container+build-rules:
   rules:
     # Run when re-enabling a disabled farm, but not when disabling it
     - !reference [.disable-farm-mr-rules, rules]
     # Run pipeline by default in the main project if any CI pipeline
     # configuration files were changed, to ensure docker images are up to date
     - if: *is-post-merge
-      changes:
-      - .gitlab-ci.yml
-      - .gitlab-ci/**/*
+      changes: &all_paths
+        - VERSION
+        - bin/git_sha1_gen.py
+        - bin/install_megadrivers.py
+        - bin/symbols-check.py
+        # GitLab CI
+        - .gitlab-ci.yml
+        - .gitlab-ci/**/*
+        # Meson
+        - meson*
+        - build-support/**/*
+        - subprojects/**/*
+        # Source code
+        - include/**/*
+        - src/**/*
       when: on_success
     # Run pipeline by default if it was triggered by Marge Bot, is for a
     # merge request, and any files affecting the pipeline were changed
@@ -230,6 +197,19 @@ include:
     # Always allow user branches etc to trigger jobs manually
     - when: manual
 
+
+.ci-deqp-artifacts:
+  artifacts:
+    name: "mesa_${CI_JOB_NAME}"
+    when: always
+    untracked: false
+    paths:
+      # Watch out!  Artifacts are relative to the build dir.
+      # 
https://gitlab.com/gitlab-org/gitlab-ce/commit/8788fb925706cad594adf6917a6c5f6587dd1521
+      - artifacts
+      - _build/meson-logs/*.txt
+      - _build/meson-logs/strace
+
 # Git archive
 
 make git archive:
diff --git a/.gitlab-ci/build/gitlab-ci.yml b/.gitlab-ci/build/gitlab-ci.yml
index 4292db7ffb2..1de4c3ea8c8 100644
--- a/.gitlab-ci/build/gitlab-ci.yml
+++ b/.gitlab-ci/build/gitlab-ci.yml
@@ -1,6 +1,6 @@
 # Shared between windows and Linux
 .build-common:
-  extends: .build-rules
+  extends: .container+build-rules
   # Cancel job if a newer commit is pushed to the same branch
   interruptible: true
   # Build jobs don't take more than 1-3 minutes. 5-8 min max on a fresh runner
diff --git a/.gitlab-ci/container/gitlab-ci.yml 
b/.gitlab-ci/container/gitlab-ci.yml
index 14d173be25d..f99ab2cf676 100644
--- a/.gitlab-ci/container/gitlab-ci.yml
+++ b/.gitlab-ci/container/gitlab-ci.yml
@@ -47,7 +47,7 @@
 .container:
   stage: container
   extends:
-    - .container-rules
+    - .container+build-rules
     - .incorporate-templates-commit
     - .use-wine
   variables:
@@ -324,7 +324,7 @@ fedora/x86_64_build:
 
 .kernel+rootfs:
   extends:
-    - .build-rules
+    - .container+build-rules
   stage: container
   variables:
     GIT_STRATEGY: fetch
@@ -374,7 +374,7 @@ kernel+rootfs_arm32:
     - .fdo.container-build@debian
     - .container
     # Don't want the .container rules
-    - .build-rules
+    - .container+build-rules
   variables:
     FDO_DISTRIBUTION_TAG: 
"${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${KERNEL_TAG}--${MESA_TEMPLATES_COMMIT}"
     ARTIFACTS_PREFIX: "https://${S3_HOST}/mesa-lava";
@@ -450,7 +450,7 @@ debian/arm64_test:
     - .windows-shell-tags
   rules:
     - !reference [.microsoft-farm-container-rules, rules]
-    - !reference [.container-rules, rules]
+    - !reference [.container+build-rules, rules]
   variables:
     GIT_STRATEGY: fetch # we do actually need the full repository though
     MESA_BASE_IMAGE: None
@@ -475,7 +475,7 @@ windows_build_vs2019:
     - .windows_container_build
   rules:
     - !reference [.microsoft-farm-rules, rules]
-    - !reference [.build-rules, rules]
+    - !reference [.container+build-rules, rules]
   variables:
     MESA_IMAGE_PATH: &windows_build_image_path ${WINDOWS_X64_BUILD_PATH}
     MESA_IMAGE_TAG: &windows_build_image_tag 
${MESA_BASE_IMAGE_TAG}--${WINDOWS_X64_BUILD_TAG}
@@ -494,7 +494,7 @@ windows_test_vs2019:
     - .windows_container_build
   rules:
     - !reference [.microsoft-farm-rules, rules]
-    - !reference [.build-rules, rules]
+    - !reference [.container+build-rules, rules]
   variables:
     MESA_IMAGE_PATH: &windows_test_image_path ${WINDOWS_X64_TEST_PATH}
     MESA_IMAGE_TAG: &windows_test_image_tag 
${MESA_BASE_IMAGE_TAG}--${WINDOWS_X64_TEST_TAG}
diff --git a/docs/gitlab-ci.yml b/docs/gitlab-ci.yml
index b08c060af31..849953b292b 100644
--- a/docs/gitlab-ci.yml
+++ b/docs/gitlab-ci.yml
@@ -3,7 +3,7 @@
     BUILDER: html
   extends:
     - .fdo.ci-fairy
-    - .build-rules
+    - .container+build-rules
   artifacts:
     expose_as: 'Documentation preview'
     paths:

Reply via email to