[glib/wip/pwithnall/ci-cleanups: 2/7] ci: Replace .build-only-schedules template with multiple extension




commit c44abdc7a2de7e9352577e246c4d6b72ebc78632
Author: Philip Withnall <pwithnall endlessos org>
Date:   Sun Feb 20 12:30:19 2022 +0000

    ci: Replace .build-only-schedules template with multiple extension
    
    `.build` and `.only-schedules` are orthogonal, and I want to use
    `.only-schedules` together with `.cross-template` in future, which would
    require creating more cross-product templates.
    
    Avoid that by splitting `extends: .build-only-schedules` into
    ```
    extends:
      - .build
      - .only-schedules
    ```
    
    Multiple extends are supported by GitLab: https://docs.gitlab.com/ee/ci/yaml/#extends
    
    This introduces no functional changes.
    
    Signed-off-by: Philip Withnall <pwithnall endlessos org>

 .gitlab-ci.yml | 37 ++++++++++++++++++++++++-------------
 1 file changed, 24 insertions(+), 13 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 999e9d5b4..1969b835d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -26,19 +26,20 @@ variables:
   except:
     - tags
 
-.build:
-  extends: .only-default
-  before_script:
-    - bash .gitlab-ci/show-execution-environment.sh
-    - cp -r $HOME/subprojects/* subprojects/
-
 # Some jobs take a long time and are unlikely to find failures (or will find
 # failures which are not merge-blockers to fix), so they’re executed on a weekly
 # schedule in order to save CI resources and speed up branch pipelines.
-.build-only-schedules:
-  extends: .build
+.only-schedules:
   only:
     - schedules
+  except:
+    - tags
+
+.build:
+  extends: .only-default
+  before_script:
+    - bash .gitlab-ci/show-execution-environment.sh
+    - cp -r $HOME/subprojects/* subprojects/
 
 style-check-diff:
   extends: .only-default
@@ -139,7 +140,9 @@ debian-stable-x86_64:
       - "_build/${CI_JOB_NAME}-report.xml"
 
 installed-tests:
-  extends: .build-only-schedules
+  extends:
+    - .build
+    - .only-schedules
   image: $FEDORA_IMAGE
   stage: build
   needs: []
@@ -175,7 +178,9 @@ installed-tests:
       - "_build/installed-tests-report/"
 
 G_DISABLE_ASSERT:
-  extends: .build-only-schedules
+  extends:
+    - .build
+    - .only-schedules
   image: $FEDORA_IMAGE
   stage: build
   needs: []
@@ -202,7 +207,9 @@ G_DISABLE_ASSERT:
       - "_build/${CI_JOB_NAME}-report.xml"
 
 valgrind:
-  extends: .build-only-schedules
+  extends:
+    - .build
+    - .only-schedules
   image: $FEDORA_IMAGE
   stage: analysis
   needs: []
@@ -478,7 +485,9 @@ coverage:
   coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
 
 scan-build:
-  extends: .build-only-schedules
+  extends:
+    - .build
+    - .only-schedules
   image: $FEDORA_IMAGE
   stage: analysis
   needs: []
@@ -502,7 +511,9 @@ scan-build:
       - "_scan_build/meson-logs/scanbuild"
 
 coverity:
-  extends: .build-only-schedules
+  extends:
+    - .build
+    - .only-schedules
   image: $COVERITY_IMAGE
   stage: analysis
   needs: []


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]