diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2022-06-29 12:38:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-29 05:38:49 -0400 |
commit | d80b5dd149b0e1938fe871851ad1a67fdc717b81 (patch) | |
tree | b0212f7fb3ddaabc7285df4f89ea36af602faa94 /.github | |
parent | d2ae1595c0af56295930e152b0eefcaf290c5893 (diff) |
Fix build matrix generation for build workflow. (#13254)
* Fix build matrix generation for build workflow.
* Fix build matrix sorting.
* Fix further typos.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build.yml | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16196342b4..c2f8505cff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -173,19 +173,24 @@ jobs: from ruamel.yaml import YAML import json yaml = YAML(typ='safe') + entries = list() + with open('.github/data/distros.yml') as f: data = yaml.load(f) - del data['platform_map'] + for i, v in enumerate(data['include']): - data['include'][i]['artifact_key'] = data['include'][i]['distro'] + str(data['include'][i]['version']).replace('.', '') - if 'packages' in data['include'][i]: - del data['include'][i]['packages'] - if 'base_image' in data['include'][i]: - data['include'][i]['distro'] = data['include'][i]['base_image'] - del data['include'][i]['base_image'] - data['include'][i]['distro'] = ':'.join([data['include'][i]['distro'], str(data['include'][i]['version'])]) - del data['include'][i]['version'] - matrix = json.dumps(data, sort_keys=True) + entries.append(data['include'][i]) + entries[i]['artifact_key'] = entries[i]['distro'] + str(entries[i]['version']).replace('.', '') + if 'packages' in entries[i]: + del entries[i]['packages'] + if 'base_image' in entries[i]: + entries[i]['distro'] = entries[i]['base_image'] + del entries[i]['base_image'] + entries[i]['distro'] = ':'.join([entries[i]['distro'], str(entries[i]['version'])]) + del entries[i]['version'] + + entries.sort(key=lambda k: k['distro']) + matrix = json.dumps({'include': entries}, sort_keys=True) print('Generated Matrix: ' + matrix) print('::set-output name=matrix::' + matrix) - name: Failure Notification |