summaryrefslogtreecommitdiffstats
path: root/.github/scripts/gen-matrix-eol-check.py
blob: dc740065ccc8be3f78f7238a4a59c5ab672d12ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python3
'''Generate the build matrix for the EOL check jobs.'''

import json

from ruamel.yaml import YAML

yaml = YAML(typ='safe')
entries = list()

with open('.github/data/distros.yml') as f:
    data = yaml.load(f)

for item in data['include']:
    if 'eol_check' in item and item['eol_check']:
        entries.append({
            'distro': item['distro'],
            'release': item['version'],
            'full_name': f'{ item['distro'] } { item['version'] }'
        })

entries.sort(key=lambda k: (k['distro'], k['release']))
matrix = json.dumps({'include': entries}, sort_keys=True)
print(matrix)