Add new `test` key to distros.yml entries. (#13241)
* Add new `test` key to distros.yml entries. To be used when generating build matrices to filter for specific tests to be run. Currently just indicates whether we should be testing eBPF CO-RE code on that distro. * Clean up build matrix generation. This ensures the other changes have no impact, and makes the code more future-proof. * Fix typo. * Fix jsonc handling.
Austin S. Hemmelgarn committed
Jun 30, 2022 at 17:07 UTC
f87ca842e1700f289ec36133fbb7557148531de4
2 files changed
+45
-9
.github/data/distros.yml
+28
@@ -24,6 +24,8 @@ include:
24
apk add -U bash
25
jsonc_removal: |
26
apk del json-c-dev
27
+ test:
28
+ ebpf-core: true
29
- <<: *alpine
30
version: "3.16"
31
- <<: *alpine
@@ -37,6 +39,8 @@ include:
39
version: latest
40
env_prep: |
41
pacman --noconfirm -Syu && pacman --noconfirm -Sy grep libffi
42
+ test:
43
+ ebpf-core: true
44
45
- &alma
46
distro: almalinux
@@ -50,6 +54,8 @@ include:
54
arches:
55
- x86_64
56
- aarch64
57
+ test:
58
+ ebpf-core: true
59
- <<: *alma
60
version: "8"
61
packages:
@@ -63,6 +69,8 @@ include:
69
repo_distro: el/7
70
arches:
71
- x86_64
72
+ test:
73
+ ebpf-core: false
74
75
- &debian
76
distro: debian
@@ -79,16 +87,22 @@ include:
87
- amd64
88
- armhf
89
- arm64
90
+ test:
91
+ ebpf-core: true
92
- <<: *debian
93
version: "10"
94
packages:
95
<<: *debian_packages
96
repo_distro: debian/buster
97
+ test:
98
+ ebpf-core: false
99
- <<: *debian
100
version: "9"
101
packages:
102
<<: *debian_packages
103
repo_distro: debian/stretch
104
+ test:
105
+ ebpf-core: false
106
107
- &fedora
108
distro: fedora
@@ -102,11 +116,15 @@ include:
116
- x86_64
117
- armhfp
118
- aarch64
119
+ test:
120
+ ebpf-core: true
121
- <<: *fedora
122
version: "35"
123
packages:
124
<<: *fedora_packages
125
repo_distro: fedora/35
126
+ test:
127
+ ebpf-core: true
128
129
- &opensuse
130
distro: opensuse
@@ -120,11 +138,15 @@ include:
138
arches:
139
- x86_64
140
- aarch64
141
+ test:
142
+ ebpf-core: true
143
- <<: *opensuse
144
version: "15.3"
145
packages:
146
<<: *opensuse_packages
147
repo_distro: opensuse/15.3
148
+ test:
149
+ ebpf-core: false
150
151
- distro: oraclelinux
152
version: "8"
@@ -136,6 +158,8 @@ include:
158
arches:
159
- x86_64
160
- aarch64
161
+ test:
162
+ ebpf-core: true
163
164
- &ubuntu
165
distro: ubuntu
@@ -151,6 +175,8 @@ include:
175
- amd64
176
- armhf
177
- arm64
178
+ test:
179
+ ebpf-core: true
180
- <<: *ubuntu
181
version: "21.10"
182
packages:
@@ -171,3 +197,5 @@ include:
197
- amd64
198
- armhf
199
- arm64
200
+ test:
201
+ ebpf-core: false
.github/workflows/build.yml
+17
-9
@@ -179,15 +179,23 @@ jobs:
179
data = yaml.load(f)
180
181
for i, v in enumerate(data['include']):
182
- entries.append(data['include'][i])
183
- entries[i]['artifact_key'] = entries[i]['distro'] + str(entries[i]['version']).replace('.', '')
184
- if 'packages' in entries[i]:
185
- del entries[i]['packages']
186
- if 'base_image' in entries[i]:
187
- entries[i]['distro'] = entries[i]['base_image']
188
- del entries[i]['base_image']
189
- entries[i]['distro'] = ':'.join([entries[i]['distro'], str(entries[i]['version'])])
190
- del entries[i]['version']
182
+ e = {
183
+ 'artifact_key': v['distro'] + str(v['version']).replace('.', ''),
184
+ 'version': v['version'],
185
+ }
186
+
187
+ if 'base_image' in v:
188
+ e['distro'] = ':'.join([v['base_image'], str(v['version'])])
189
+ else:
190
+ e['distro'] = ':'.join([v['distro'], str(v['version'])])
191
+
192
+ if 'env_prep' in v:
193
+ e['env_prep'] = v['env_prep']
194
+
195
+ if 'jsonc_removal' in v:
196
+ e['jsonc_removal'] = v['jsonc_removal']
197
+
198
+ entries.append(e)
199
200
entries.sort(key=lambda k: k['distro'])
201
matrix = json.dumps({'include': entries}, sort_keys=True)