gitlab CI: hook up the meson build
[platform/upstream/libevdev.git] / .gitlab-ci / generate-gitlab-ci.py
1 #!/usr/bin/env python3
2 # vim: set expandtab shiftwidth=4:
3
4 # This file generates the .gitlab-ci.yml file that defines the pipeline.
5
6 import jinja2
7
8 distributions = [
9     {'name': 'fedora', 'version': '30'},
10     {'name': 'fedora', 'version': '31'},
11     {'name': 'ubuntu', 'version': '19.10'},
12     {'name': 'ubuntu', 'version': '19.04'},
13     {'name': 'debian', 'version': 'stable'},
14     {'name': 'debian', 'version': 'sid'},
15     {
16         'name': 'centos', 'version': '7',
17         'build': {
18             'extra_variables': {
19                 'MAKE_ARGS': ('\'\'  # disable distcheck, requires doxygen'),
20             }
21         },
22         'meson': False
23     },
24     {
25         'name': 'centos', 'version': '8',
26         'build': {
27             'extra_variables': {
28                 'MAKE_ARGS': ('\'\'  # disable distcheck, requires doxygen'),
29             }
30         },
31         'meson': False
32     },
33     {'name': 'arch', 'version': 'rolling',
34      'flavor': 'archlinux' },  # see https://gitlab.freedesktop.org/wayland/ci-templates/merge_requests/19
35     {'name': 'alpine', 'version': 'latest'},
36 ]
37
38
39 def generate_template():
40     env = jinja2.Environment(loader=jinja2.FileSystemLoader('./.gitlab-ci'),
41                              trim_blocks=True, lstrip_blocks=True)
42
43     template = env.get_template('gitlab-ci.tmpl')
44     config = {'distributions': distributions}
45     with open('.gitlab-ci.yml', 'w') as fd:
46         template.stream(config).dump(fd)
47
48
49 if __name__ == '__main__':
50     generate_template()