[PATCH v5 13/13] CI: gate macos build jobs with MACOS_JOBS variable

Marek Marczykowski-Górecki <[email protected]>
Newsgroups org.xenproject.lists.xen-devel
Message-ID <1c63c71893b9cc2cb6cf2dacaad8fb96fab6cdb8.1785941707.git-series.marmarek@invisiblethingslab.com>
The macos runners have limited availability (they aren't enabled for all
repositories, and have a monthly usage limit). Do not schedule macos
build jobs unless explicitly enabled with MACOS_JOBS=true variable.
Note: just setting the variable is not enough to have macos builds,
relevant runners need to be enabled too. Unfortunately there isn't any
built-in variable signaling runners availability.

Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
---
New in v5

MACOS_JOBS=true wants to be set as a group variable in
xen-project/hardware group. Specifically, on this page:
https://gitlab.com/groups/xen-project/hardware/-/settings/ci_cd#ci-variables
---
 automation/gitlab-ci/build.yaml | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 27eefec5f9a5..85831f44838b 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -13,7 +13,7 @@
       - '*/*.log'
     when: always
   needs: []
-  rules:
+  rules: &build-rules
     - if: $BUILD_FOR_TESTS_ONLY
       when: never
     - if: $CI_JOB_NAME =~ $SELECTED_JOBS_ONLY
@@ -806,6 +806,10 @@ debian-13-riscv64-gcc-randconfig:
 # macOS build jobs
 .macos-26:
   <<: *build
+  rules:
+    - if: $MACOS_JOBS != true
+      when: never
+    - *build-rules
   tags:
     - saas-macos-medium-m1
   image: macos-26-xcode-26
-- 
git-series 0.9.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.