+++ /dev/null
-#!/usr/bin/env python3
-# vim: set expandtab shiftwidth=4:
-
-# This file generates the .gitlab-ci.yml file that defines the pipeline.
-
-import jinja2
-
-distributions = [
- {'name': 'fedora', 'version': '30'},
- {'name': 'fedora', 'version': '31'},
- {'name': 'ubuntu', 'version': '19.10'},
- {'name': 'ubuntu', 'version': '19.04'},
- {'name': 'arch', 'version': 'rolling'},
- {
- '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',
- ]
- },
- }
-]
-
-templates = sorted(set([x['name'] for x in distributions]))
-
-# in reverse order of duration to get the slowest ones started first
-test_suites = [
- {'name': 'touchpad', 'suites': 'touchpad'},
- {'name': 'tap', 'suites': 'tap'},
- {'name': 'tablet', 'suites': 'tablet'},
- {'name': 'gestures-device', 'suites': 'gestures device'},
- {'name': 'others',
- 'suites': 'context config misc events totem udev lid log timer tablet-mode quirks trackball pad path keyboard switch touch trackpoint'},
- {'name': 'pointer', 'suites': 'pointer'}
-]
-
-
-def generate_template():
- env = jinja2.Environment(loader=jinja2.FileSystemLoader('./.gitlab-ci'),
- trim_blocks=True, lstrip_blocks=True)
-
- template = env.get_template('gitlab-ci.tmpl')
- config = {'distributions': distributions,
- 'test_suites': test_suites,
- 'templates': templates}
- with open('.gitlab-ci.yml', 'w') as fd:
- template.stream(config).dump(fd)
-
-
-if __name__ == '__main__':
- generate_template()
# vim: set expandtab shiftwidth=2 tabstop=8 textwidth=0 filetype=yaml:
+
+{# You're looking at the template here, so you can ignore the below
+ warning. This is the right file to edit #}
+########################################
+# #
+# THIS FILE IS GENERATED, DO NOT EDIT #
+# #
+########################################
+
#
# This is a bit complicated for two reasons:
# - we really want to run dnf/apt/... only once, updating on the test runner for
.templates_sha: &template_sha 395535ce90eb48e260c0dff12c35d9237e22c539 # see https://docs.gitlab.com/ee/ci/yaml/#includefile
include:
- {% for template in templates %}
- # {{ template.capitalize() }} container builder template
+ {% for distro in distributions|sort(attribute="name") %}
+ {% if distro.ci_templates %}
+ # {{ distro.name.capitalize() }} container builder template
- project: 'freedesktop/ci-templates'
ref: *template_sha
- file: '/templates/{{template}}.yml'
+ file: '/templates/{{distro.name}}.yml'
+ {% endif %}
{% endfor %}
stages:
# changing these will force rebuilding the associated image
# Note: these tags have no meaning and are not tied to a particular
# libinput version
- FEDORA_TAG: '2020-03-17.0'
- UBUNTU_TAG: '2020-03-17.0'
- ARCH_TAG: '2020-03-17.0'
- ALPINE_TAG: '2020-03-17.0'
- FREEBSD_TAG: '2020-03-17.0'
- QEMU_TAG: 'qemu-vm-2020-03-17.0'
+{% for distro in distributions %}
+ {{"%-13s"| format(distro.name.upper() + '_TAG:')}}'{{distro.tag}}'
+{% endfor %}
+{% for distro in distributions %}
+{% if distro.want_qemu %}
+ QEMU_TAG: 'qemu-vm-{{distro.tag}}'
+{% endif %}
+{% endfor %}
UBUNTU_EXEC: "bash .gitlab-ci/ubuntu_install.sh $UBUNTU_CUSTOM_DEBS"
stage: prep
before_script:
- apk add python3 git
- - pip3 install --user jinja2
+ - pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates
script:
- - python3 ./.gitlab-ci/generate-gitlab-ci.py
+ - ci-fairy generate-template --config .gitlab-ci/config.yml .gitlab-ci/gitlab-ci.tmpl -o .gitlab-ci.yml
- git diff --exit-code && exit 0 || true
- echo "Committed gitlab-ci.yml differs from generated gitlab-ci.yml. Please verify"
- exit 1
allow_failure: true
{% for distro in distributions %}
-{{distro.name}}:{{distro.version}}@container-prep:
+{% for version in distro.versions %}
+{{distro.name}}:{{version}}@container-prep:
extends:
- .fdo.container-build@{{distro.name}}
- .policy
stage: prep
variables:
GIT_STRATEGY: none
- FDO_DISTRIBUTION_VERSION: '{{distro.version}}'
+ FDO_DISTRIBUTION_VERSION: '{{version}}'
FDO_DISTRIBUTION_PACKAGES: ${{distro.name.upper()}}_PACKAGES
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
{% if version == 'ubuntu'%}
{% endif %}
{% endfor %}
+{% endfor %}
# Note that we want to use the latest buildah image, and for that
- schedules
{% for distro in distributions %}
-{{distro.name}}:{{distro.version}}@container-clean:
+{% for version in distro.versions %}
+{{distro.name}}:{{version}}@container-clean:
extends:
- .container-clean
variables:
GIT_STRATEGY: none
- {{distro.name.upper()}}_VERSION: '{{distro.version}}'
+ {{distro.name.upper()}}_VERSION: '{{version}}'
CURRENT_CONTAINER_IMAGE: $CI_REGISTRY_IMAGE/{{distro.name}}/$FDO_DISTRIBUTION_VERSION:$FDO_DISTRIBUTION_TAG
- FDO_DISTRIBUTION_VERSION: '{{distro.version}}'
+ FDO_DISTRIBUTION_VERSION: '{{version}}'
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
{% endfor %}
+{% endfor %}
freebsd:11.2@container-clean:
extends:
#################################################################
{% for distro in distributions %}
-{{distro.name}}:{{distro.version}}@default-build:
+{% for version in distro.versions %}
+{{distro.name}}:{{version}}@default-build:
stage: distro
extends:
- .build@template
- .fdo.distribution-image@{{distro.name}}
variables:
- FDO_DISTRIBUTION_VERSION: '{{distro.version}}'
+ FDO_DISTRIBUTION_VERSION: '{{version}}'
FDO_DISTRIBUTION_TAG: ${{distro.name.upper()}}_TAG
{# Where we have extra_variables defined, add them to the list #}
{% if distro.build is defined and distro.build.extra_variables is defined %}
{{var}}
{% endfor %}
{% endif %}
- needs: ['{{distro.name}}:{{distro.version}}@container-prep']
+ needs: ['{{distro.name}}:{{version}}@container-prep']
{% endfor %}
+{% endfor %}
#
# FreeBSD