summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-02-20 12:48:16 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-02-20 13:39:32 +1000
commit02f5da42b24a00fa9ef698a88684dd46c49970f3 (patch)
treead1794dc75fa3b4290f6900aeeb428701e9d5cbf
parent90888ab9f23963a08f39121ceb8d0c769469e8a0 (diff)
gitlab CI: generate the various default-builds through templating
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--.gitlab-ci.yml90
-rwxr-xr-x.gitlab-ci/generate-gitlab-ci.py13
-rw-r--r--.gitlab-ci/gitlab-ci.tmpl86
3 files changed, 72 insertions, 117 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 787cc3bc..9f041bec 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -633,27 +633,12 @@ fedora:30@valgrind-pointer:
MESON_TEST_ARGS: '--setup=valgrind'
+
.fedora-build@template:
extends:
- .build@template
image: $FEDORA_CONTAINER_IMAGE
-fedora:31@default-build:
- stage: distro
- extends:
- - .fedora-build@template
- variables:
- FEDORA_VERSION: 31
- needs: ['fedora:31@container-prep']
-
-fedora:30@default-build:
- stage: distro
- extends:
- - .fedora-build@template
- variables:
- FEDORA_VERSION: 30
- needs: ['fedora:30@container-prep']
-
fedora:30@default-build-release:
stage: distro
extends:
@@ -791,65 +776,74 @@ fedora:30@flake8:
- flake8-3 --ignore=W501,E501,W504 $(git grep -l '^#!/usr/bin/env python3')
needs: ['fedora:30@container-prep']
-#
-# Ubuntu
-#
+#################################################################
+# #
+# distro stage #
+# #
+#################################################################
-.ubuntu@template:
+fedora:30@default-build:
stage: distro
extends:
- .build@template
- image: $UBUNTU_CONTAINER_IMAGE
+ image: $FEDORA_CONTAINER_IMAGE
+ variables:
+ FEDORA_VERSION: '30'
+ needs: ['fedora:30@container-prep']
+
+
+fedora:31@default-build:
+ stage: distro
+ extends:
+ - .build@template
+ image: $FEDORA_CONTAINER_IMAGE
+ variables:
+ FEDORA_VERSION: '31'
+ needs: ['fedora:31@container-prep']
+
ubuntu:19.10@default-build:
+ stage: distro
extends:
- - .ubuntu@template
+ - .build@template
+ image: $UBUNTU_CONTAINER_IMAGE
variables:
- UBUNTU_VERSION: "19.10"
+ UBUNTU_VERSION: '19.10'
needs: ['ubuntu:19.10@container-prep']
+
ubuntu:19.04@default-build:
+ stage: distro
extends:
- - .ubuntu@template
+ - .build@template
+ image: $UBUNTU_CONTAINER_IMAGE
variables:
- UBUNTU_VERSION: "19.04"
+ UBUNTU_VERSION: '19.04'
needs: ['ubuntu:19.04@container-prep']
-#
-# Arch
-#
-.arch@template:
+
+arch:rolling@default-build:
stage: distro
extends:
- .build@template
image: $ARCH_CONTAINER_IMAGE
-
-arch:rolling@default-build:
- extends:
- - .arch@template
+ variables:
+ ARCH_VERSION: 'rolling'
needs: ['arch:rolling@container-prep']
-#
-# Alpine
-#
-.alpine@template:
+alpine:latest@default-build:
stage: distro
extends:
- .build@template
image: $ALPINE_CONTAINER_IMAGE
-
-alpine:latest@default-build:
- extends:
- - .alpine@template
- needs: ['alpine:latest@container-prep']
variables:
- # alpine doesn't have python-recommonmark
- MESON_ARGS: '-Ddocumentation=false'
- # We don't run the tests on alpine. The litest-selftest fails
- # for any tcase_add_exit_test/tcase_add_test_raise_signal
- # but someone more invested in musl will have to figure that out.
- MESON_TEST_ARGS: ''
+ ALPINE_VERSION: 'latest'
+ MESON_ARGS: '-Ddocumentation=false' # alpine does not have python-recommonmark
+ MESON_TEST_ARGS: '' # litest-selftest fails on musl
+ needs: ['alpine:latest@container-prep']
+
+
#
# FreeBSD
diff --git a/.gitlab-ci/generate-gitlab-ci.py b/.gitlab-ci/generate-gitlab-ci.py
index e8be754f..b3a05075 100755
--- a/.gitlab-ci/generate-gitlab-ci.py
+++ b/.gitlab-ci/generate-gitlab-ci.py
@@ -12,7 +12,18 @@ distributions = [
{'name': 'ubuntu', 'version': '19.04'},
{'name': 'arch', 'version': 'rolling',
'flavor': 'archlinux'}, # see https://gitlab.freedesktop.org/wayland/ci-templates/merge_requests/19
- {'name': 'alpine', 'version': 'latest'},
+ {
+ 'name': 'alpine', 'version': 'latest',
+ 'build': {
+ 'extra_variables': [
+ 'MESON_ARGS: \'-Ddocumentation=false\' # alpine does not have python-recommonmark',
+ # We don't run the tests on alpine. The litest-selftest fails
+ # for any tcase_add_exit_test/tcase_add_test_raise_signal
+ # but someone more invested in musl will have to figure that out.
+ 'MESON_TEST_ARGS: \'\' # litest-selftest fails on musl',
+ ]
+ },
+ }
]
# in reverse order of duration to get the slowest ones started first
diff --git a/.gitlab-ci/gitlab-ci.tmpl b/.gitlab-ci/gitlab-ci.tmpl
index 529e82f3..c7f43e81 100644
--- a/.gitlab-ci/gitlab-ci.tmpl
+++ b/.gitlab-ci/gitlab-ci.tmpl
@@ -461,27 +461,12 @@ fedora:30@valgrind-{{suite.name}}:
{% endfor %}
+
.fedora-build@template:
extends:
- .build@template
image: $FEDORA_CONTAINER_IMAGE
-fedora:31@default-build:
- stage: distro
- extends:
- - .fedora-build@template
- variables:
- FEDORA_VERSION: 31
- needs: ['fedora:31@container-prep']
-
-fedora:30@default-build:
- stage: distro
- extends:
- - .fedora-build@template
- variables:
- FEDORA_VERSION: 30
- needs: ['fedora:30@container-prep']
-
fedora:30@default-build-release:
stage: distro
extends:
@@ -619,65 +604,30 @@ fedora:30@flake8:
- flake8-3 --ignore=W501,E501,W504 $(git grep -l '^#!/usr/bin/env python3')
needs: ['fedora:30@container-prep']
-#
-# Ubuntu
-#
+#################################################################
+# #
+# distro stage #
+# #
+#################################################################
-.ubuntu@template:
+{% for distro in distributions %}
+{{distro.name}}:{{distro.version}}@default-build:
stage: distro
extends:
- .build@template
- image: $UBUNTU_CONTAINER_IMAGE
-
-ubuntu:19.10@default-build:
- extends:
- - .ubuntu@template
+ image: ${{distro.name.upper()}}_CONTAINER_IMAGE
variables:
- UBUNTU_VERSION: "19.10"
- needs: ['ubuntu:19.10@container-prep']
-
-ubuntu:19.04@default-build:
- extends:
- - .ubuntu@template
- variables:
- UBUNTU_VERSION: "19.04"
- needs: ['ubuntu:19.04@container-prep']
-
-#
-# Arch
-#
-.arch@template:
- stage: distro
- extends:
- - .build@template
- image: $ARCH_CONTAINER_IMAGE
-
-arch:rolling@default-build:
- extends:
- - .arch@template
- needs: ['arch:rolling@container-prep']
+ {{distro.name.upper()}}_VERSION: '{{distro.version}}'
+ {# Where we have extra_variables defined, add them to the list #}
+ {% if distro.build is defined and distro.build.extra_variables is defined %}
+ {% for var in distro.build.extra_variables %}
+ {{var}}
+ {% endfor %}
+ {% endif %}
+ needs: ['{{distro.name}}:{{distro.version}}@container-prep']
-#
-# Alpine
-#
-.alpine@template:
- stage: distro
- extends:
- - .build@template
- image: $ALPINE_CONTAINER_IMAGE
-
-alpine:latest@default-build:
- extends:
- - .alpine@template
- needs: ['alpine:latest@container-prep']
- variables:
- # alpine doesn't have python-recommonmark
- MESON_ARGS: '-Ddocumentation=false'
- # We don't run the tests on alpine. The litest-selftest fails
- # for any tcase_add_exit_test/tcase_add_test_raise_signal
- # but someone more invested in musl will have to figure that out.
- MESON_TEST_ARGS: ''
+{% endfor %}
#
# FreeBSD