gitlab CI: generate the jobs for the custom builds from the config.yaml
authorPeter Hutterer <peter.hutterer@who-t.net>
Sun, 22 Mar 2020 02:27:51 +0000 (12:27 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 23 Mar 2020 07:05:28 +0000 (07:05 +0000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
.gitlab-ci/ci.template
.gitlab-ci/config.yml

index d08548b959a5070236f358f8149267e672fe976e..047b19f93d7273e5398df1e83773b9148277c5aa 100644 (file)
@@ -454,27 +454,29 @@ vm-valgrind-{{suite.name}}:
 
 {% endfor %} {# for if distro.want_qemu #}
 
-.fedora-build@template:
+{% for distro in distributions if distro.use_for_custom_build_tests %}
+{% set version = "{}".format(distro.versions|last()) %}
+.{{distro.name}}-build@template:
   extends:
     - .fdo.distribution-image@fedora
     - .build@template
   variables:
-    FDO_DISTRIBUTION_VERSION: '32'
-    FDO_DISTRIBUTION_TAG: $FEDORA_TAG
+    FDO_DISTRIBUTION_VERSION: '{{version}}'
+    FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
   needs:
-    - "fedora:32@container-prep"
+    - "{{distro.name}}:{{version}}@container-prep"
 
-default-build-release@fedora:32:
+default-build-release@{{distro.name}}:{{version}}:
   stage: distro
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Dbuildtype=release"
     CFLAGS: "-Werror"
 
-scan-build@fedora:32:
+scan-build@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     NINJA_ARGS: scan-build
     MESON_TEST_ARGS: ''
@@ -490,65 +492,65 @@ scan-build@fedora:32:
 # run them on one image, they shouldn't fail on one distro
 # when they succeed on another.
 
-build-no-libwacom@fedora:32:
+build-no-libwacom@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Dlibwacom=false"
 
-build-no-libwacom-nodeps@fedora:32:
+build-no-libwacom-nodeps@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Dlibwacom=false"
   before_script:
     - dnf remove -y libwacom libwacom-devel
 
-build-no-docs@fedora:32:
+build-no-docs@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Ddocumentation=false"
 
-build-no-docs-nodeps@fedora:32:
+build-no-docs-nodeps@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Ddocumentation=false"
   before_script:
     - dnf remove -y doxygen graphviz
 
-build-no-debuggui@fedora:32:
+build-no-debuggui@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Ddebug-gui=false"
 
-build-no-debuggui-nodeps@fedora:32:
+build-no-debuggui-nodeps@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Ddebug-gui=false"
   before_script:
     - dnf remove -y gtk3-devel
 
-build-no-tests@fedora:32:
+build-no-tests@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Dtests=false"
 
-build-no-tests-nodeps@fedora:32:
+build-no-tests-nodeps@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_ARGS: "-Dtests=false"
   before_script:
     - dnf remove -y check-devel
 
-valgrind@fedora:32:
+valgrind@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   variables:
     MESON_TEST_ARGS: '--suite=valgrind --no-suite=hardware --setup=valgrind'
   before_script:
@@ -556,9 +558,9 @@ valgrind@fedora:32:
 
 # Python checks, only run on Fedora
 
-usr-bin-env-python@fedora:32:
+usr-bin-env-python@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   script:
     - |
       if git grep -l '^#!/usr/bin/python'; then
@@ -566,14 +568,15 @@ usr-bin-env-python@fedora:32:
         /bin/false
       fi
 
-flake8@fedora:32:
+flake8@{{distro.name}}:{{version}}:
   extends:
-    - .fedora-build@template
+    - .{{distro.name}}-build@template
   before_script:
     - dnf install -y python3-flake8
   script:
     - flake8-3 --ignore=W501,E501,W504 $(git grep -l '^#!/usr/bin/env python3')
 
+{% endfor %}
 #################################################################
 #                                                               #
 #                        distro stage                           #
index 6e930f6bb302afa9a7e789c134b06f38df83ace3..00fc5b6df0bf169a353a9f689c7dcf1822b861d5 100644 (file)
@@ -13,6 +13,7 @@ distributions:
       - '31'
       - '32'
     want_qemu: true
+    use_for_custom_build_tests: true
   - name: ubuntu
     tag: *default_tag
     versions: