ci: Use workflow to make CI aware of performance jobs
authorGuilherme Gallo <guilherme.gallo@collabora.com>
Mon, 27 Feb 2023 02:05:59 +0000 (23:05 -0300)
committerMarge Bot <emma+marge@anholt.net>
Tue, 28 Feb 2023 22:19:48 +0000 (22:19 +0000)
With the workflow keyword, we can have more control over how pipelines
are created.

One of the features is to set a variable for the entire pipeline
depending on the rule. These variables would be available for all jobs
manifest and can be used inside job rules, for example.

We can use that to set a variable to enable performance jobs in the
pipeline, both at the YAML and script levels.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21492>

.gitlab-ci.yml
.gitlab-ci/build/gitlab-ci.yml

index dd6839a..5a4a4b0 100644 (file)
@@ -1,3 +1,10 @@
+workflow:
+  rules:
+    - if: $GITLAB_USER_LOGIN == "marge-bot" && $CI_COMMIT_BRANCH == null
+      variables:
+        MESA_CI_PERFORMANCE_ENABLED: 1
+    - when: always
+
 variables:
   FDO_UPSTREAM_REPO: mesa/mesa
   MESA_TEMPLATES_COMMIT: &ci-templates-commit d5aa3941aa03c2f716595116354fb81eb8012acb
index 51f1b69..4436788 100644 (file)
@@ -227,7 +227,7 @@ debian-release:
     MINIO_ARTIFACT_NAME: "mesa-amd64-rel"
   script:
     - .gitlab-ci/meson/build.sh
-    - .gitlab-ci/prepare-artifacts.sh
+    - 'if [ -n "$MESA_CI_PERFORMANCE_ENABLED" ]; then .gitlab-ci/prepare-artifacts.sh; fi'
 
 alpine-build-testing:
   extends:
@@ -468,6 +468,9 @@ debian-arm64-release:
     BUILDTYPE: "release"
     C_ARGS: >
       -Wno-error=stringop-truncation
+  script:
+    - .gitlab-ci/meson/build.sh
+    - 'if [ -n "$MESA_CI_PERFORMANCE_ENABLED" ]; then .gitlab-ci/prepare-artifacts.sh; fi'
 
 debian-clang:
   extends: .meson-build