@@ -16,29 +16,15 @@ jobs:
16
16
matrix :
17
17
os : [ fedora-rawhide, fedora-40, fedora-39, centos-9-stream, rocky-9, rocky-8, almalinux-9, almalinux-8 ]
18
18
docker : [ docker ]
19
- include :
20
- - os : rhel-9
21
- docker : podman
22
- - os : rhel-8
23
- docker : podman
24
19
timeout-minutes : 15
25
20
steps :
26
21
- uses : actions/checkout@v4
27
- - name : Install podman 4.*
28
- uses : ./.github/actions/install-podman-4
29
- if : matrix.docker == 'podman'
30
22
- name : Separate git work tree with just the files needed for build
31
23
run : git worktree add --no-checkout ../minimize-for-build
32
24
- name : Populate with the Dockerfile
33
25
run : cd ../minimize-for-build && git checkout HEAD Dockerfile.${{ matrix.os }}
34
26
- name : Populate with files referenced from the Dockerfile
35
27
run : cd ../minimize-for-build && awk '/^(ADD|COPY)/ { for (i = 2; i < NF; i++) print $i }' Dockerfile.${{ matrix.os }} | while read f ; do git checkout HEAD $f ; done
36
- - name : For RHEL builds, use entitlements
37
- if : ${{ startsWith(matrix.os, 'rhel-') }}
38
- uses : ./.github/actions/podman-entitlement
39
- with :
40
- org : ${{ secrets.REDHAT_ORG }}
41
- activationkey : ${{ secrets.REDHAT_ACTIVATIONKEY }}
42
28
- name : Ensure docker images sees the named parent image
43
29
run : awk '$1 == "FROM" { print $2 ; exit }' ../minimize-for-build/Dockerfile.${{ matrix.os }} | xargs ${{ matrix.docker }} pull
44
30
- name : Build image
73
59
run : mkdir freeipa-server-${{ matrix.os }}
74
60
- name : Save image
75
61
run : ${{ matrix.docker }} save localhost/freeipa-server:${{ matrix.os }} | gzip > freeipa-server-${{ matrix.os }}/freeipa-server-${{ matrix.os }}.tar.gz
76
- - name : For RHEL builds, encrypt the artifacts
77
- uses : ./.github/actions/encrypt-file
78
- if : ${{ startsWith(matrix.os, 'rhel-') }}
79
- with :
80
- file : freeipa-server-${{ matrix.os }}/freeipa-server-${{ matrix.os }}.tar.gz
81
- secret : ${{ secrets.UPLOAD_SECRET }}
82
62
- uses : actions/upload-artifact@v4
83
63
with :
84
64
name : freeipa-server-${{ matrix.os }}
@@ -106,20 +86,14 @@ jobs:
106
86
- os : centos-9-stream
107
87
readonly : --read-only
108
88
ca : --external-ca
109
- os : [ fedora-39, rhel -9, rhel-8, almalinux-9 ]
89
+ os : [ fedora-39, almalinux -9, rocky-8 ]
110
90
timeout-minutes : 30
111
91
steps :
112
92
- uses : actions/checkout@v4
113
93
- uses : ./.github/actions/docker-cgroups-ubuntu-22
114
94
- uses : actions/download-artifact@v4
115
95
with :
116
96
name : freeipa-server-${{ matrix.os }}
117
- - name : Decrypt artifacts that were encrypted after build
118
- uses : ./.github/actions/decrypt-file
119
- if : ${{ startsWith(matrix.os, 'rhel-') }}
120
- with :
121
- file : freeipa-server-${{ matrix.os }}.tar.gz
122
- secret : ${{ secrets.UPLOAD_SECRET }}
123
97
- name : Load image
124
98
run : gunzip < freeipa-server-${{ matrix.os }}.tar.gz | docker load
125
99
- name : Run master and replica
@@ -135,7 +109,7 @@ jobs:
135
109
strategy :
136
110
fail-fast : false
137
111
matrix :
138
- os : [ fedora-rawhide, fedora-40, rocky-9, almalinux-9 ]
112
+ os : [ fedora-rawhide, fedora-40, rocky-9, almalinux-8 ]
139
113
readonly : [ --read-only ]
140
114
timeout-minutes : 30
141
115
steps :
@@ -145,12 +119,6 @@ jobs:
145
119
- uses : actions/download-artifact@v4
146
120
with :
147
121
name : freeipa-server-${{ matrix.os }}
148
- - name : Decrypt artifacts that were encrypted after build
149
- uses : ./.github/actions/decrypt-file
150
- if : ${{ startsWith(matrix.os, 'rhel-') }}
151
- with :
152
- file : freeipa-server-${{ matrix.os }}.tar.gz
153
- secret : ${{ secrets.UPLOAD_SECRET }}
154
122
- name : Load image
155
123
run : gunzip < freeipa-server-${{ matrix.os }}.tar.gz | docker load
156
124
- name : Run master and replica
@@ -178,12 +146,6 @@ jobs:
178
146
- uses : actions/download-artifact@v4
179
147
with :
180
148
name : freeipa-server-${{ matrix.os }}
181
- - name : Decrypt artifacts that were encrypted after build
182
- uses : ./.github/actions/decrypt-file
183
- if : ${{ startsWith(matrix.os, 'rhel-') }}
184
- with :
185
- file : freeipa-server-${{ matrix.os }}.tar.gz
186
- secret : ${{ secrets.UPLOAD_SECRET }}
187
149
- name : Load image
188
150
run : gunzip < freeipa-server-${{ matrix.os }}.tar.gz | docker load
189
151
- name : Disable fs.protected_regular
@@ -211,12 +173,6 @@ jobs:
211
173
- uses : actions/download-artifact@v4
212
174
with :
213
175
name : freeipa-server-${{ matrix.os }}
214
- - name : Decrypt artifacts that were encrypted after build
215
- uses : ./.github/actions/decrypt-file
216
- if : ${{ startsWith(matrix.os, 'rhel-') }}
217
- with :
218
- file : freeipa-server-${{ matrix.os }}.tar.gz
219
- secret : ${{ secrets.UPLOAD_SECRET }}
220
176
- name : Load image
221
177
run : gunzip < freeipa-server-${{ matrix.os }}.tar.gz | sudo podman load
222
178
- name : Run master and replica
@@ -232,7 +188,7 @@ jobs:
232
188
strategy :
233
189
fail-fast : false
234
190
matrix :
235
- os : [ fedora-40, rhel-9, rhel-8, centos-9-stream, rocky-9, rocky-8 , almalinux-8 ]
191
+ os : [ fedora-40, centos-9-stream, rocky-9, almalinux-8 ]
236
192
timeout-minutes : 30
237
193
steps :
238
194
- uses : actions/checkout@v4
@@ -241,12 +197,6 @@ jobs:
241
197
- uses : actions/download-artifact@v4
242
198
with :
243
199
name : freeipa-server-${{ matrix.os }}
244
- - name : Decrypt artifacts that were encrypted after build
245
- uses : ./.github/actions/decrypt-file
246
- if : ${{ startsWith(matrix.os, 'rhel-') }}
247
- with :
248
- file : freeipa-server-${{ matrix.os }}.tar.gz
249
- secret : ${{ secrets.UPLOAD_SECRET }}
250
200
- name : Load image
251
201
run : gunzip < freeipa-server-${{ matrix.os }}.tar.gz | podman load
252
202
- name : Run master
@@ -269,8 +219,6 @@ jobs:
269
219
data-from : fedora-39
270
220
- os : fedora-40
271
221
data-from : fedora-38
272
- - os : rhel-8
273
- data-from : centos-8
274
222
- os : rocky-8
275
223
data-from : centos-8
276
224
- os : almalinux-8
@@ -282,12 +230,6 @@ jobs:
282
230
- uses : actions/download-artifact@v4
283
231
with :
284
232
name : freeipa-server-${{ matrix.os }}
285
- - name : Decrypt artifacts that were encrypted after build
286
- uses : ./.github/actions/decrypt-file
287
- if : ${{ startsWith(matrix.os, 'rhel-') }}
288
- with :
289
- file : freeipa-server-${{ matrix.os }}.tar.gz
290
- secret : ${{ secrets.UPLOAD_SECRET }}
291
233
- name : Load image
292
234
run : gunzip < freeipa-server-${{ matrix.os }}.tar.gz | docker load
293
235
- name : Populate volume with data
@@ -313,12 +255,6 @@ jobs:
313
255
- uses : actions/download-artifact@v4
314
256
with :
315
257
name : freeipa-server-${{ matrix.os }}
316
- - name : Decrypt artifacts that were encrypted after build
317
- uses : ./.github/actions/decrypt-file
318
- if : ${{ startsWith(matrix.os, 'rhel-') }}
319
- with :
320
- file : freeipa-server-${{ matrix.os }}.tar.gz
321
- secret : ${{ secrets.UPLOAD_SECRET }}
322
258
- name : Load image
323
259
run : gunzip < freeipa-server-${{ matrix.os }}.tar.gz | podman load
324
260
- name : Populate volume with data
@@ -344,12 +280,6 @@ jobs:
344
280
- uses : actions/download-artifact@v4
345
281
with :
346
282
name : freeipa-server-${{ matrix.os }}
347
- - name : Decrypt artifacts that were encrypted after build
348
- uses : ./.github/actions/decrypt-file
349
- if : ${{ startsWith(matrix.os, 'rhel-') }}
350
- with :
351
- file : freeipa-server-${{ matrix.os }}.tar.gz
352
- secret : ${{ secrets.UPLOAD_SECRET }}
353
283
- name : Load image
354
284
run : gunzip < freeipa-server-${{ matrix.os }}.tar.gz | docker load
355
285
- name : Populate volume with data
@@ -364,20 +294,14 @@ jobs:
364
294
strategy :
365
295
fail-fast : false
366
296
matrix :
367
- os : [ fedora-rawhide, fedora-40, rhel -9, rhel -8, centos-9-stream ]
297
+ os : [ fedora-rawhide, fedora-40, rocky -9, almalinux -8, centos-9-stream ]
368
298
timeout-minutes : 30
369
299
steps :
370
300
- uses : actions/checkout@v4
371
301
- uses : ./.github/actions/docker-cgroups-ubuntu-22
372
302
- uses : actions/download-artifact@v4
373
303
with :
374
304
name : freeipa-server-${{ matrix.os }}
375
- - name : Decrypt artifacts that were encrypted after build
376
- uses : ./.github/actions/decrypt-file
377
- if : ${{ startsWith(matrix.os, 'rhel-') }}
378
- with :
379
- file : freeipa-server-${{ matrix.os }}.tar.gz
380
- secret : ${{ secrets.UPLOAD_SECRET }}
381
305
- name : Download latest cri-dockerd
382
306
run : curl -s ${{ github.api_url }}/repos/Mirantis/cri-dockerd/releases/latest | jq -r '.assets[].browser_download_url' | grep jammy_amd64.deb | tee /dev/stderr | xargs curl -LO
383
307
- name : Install cri-dockerd
@@ -435,3 +359,41 @@ jobs:
435
359
${{ secrets.REGISTRY_TARGET_LIST }}
436
360
EOF
437
361
362
+ test-subscription :
363
+ # Workaround https://github.com/actions/runner/issues/1138
364
+ name : Prerequisite for RHEL builds
365
+ runs-on : ubuntu-latest
366
+ timeout-minutes : 1
367
+ outputs :
368
+ has_rhel_subscriptions : ${{ steps.check.outputs.has_rhel_subscriptions }}
369
+ steps :
370
+ - id : check
371
+ run : |
372
+ if [ -n "${{ secrets.REDHAT_ORG }}" -a -n "${{ secrets.REDHAT_ACTIVATIONKEY }}" ] ; then
373
+ echo "has_rhel_subscriptions=1" >> $GITHUB_OUTPUT
374
+ fi
375
+
376
+ build-test-rhel-podman :
377
+ name : Build and test RHEL image
378
+ runs-on : ubuntu-22.04
379
+ needs : [ test-subscription ]
380
+ if : needs.test-subscription.outputs.has_rhel_subscriptions == 1
381
+ strategy :
382
+ fail-fast : false
383
+ matrix :
384
+ os : [ rhel-9, rhel-8 ]
385
+ timeout-minutes : 20
386
+ steps :
387
+ - uses : actions/checkout@v4
388
+ - name : Install podman 4.*
389
+ uses : ./.github/actions/install-podman-4
390
+ - name : For RHEL builds, use entitlements
391
+ uses : ./.github/actions/podman-entitlement
392
+ with :
393
+ org : ${{ secrets.REDHAT_ORG }}
394
+ activationkey : ${{ secrets.REDHAT_ACTIVATIONKEY }}
395
+ - name : Build image
396
+ run : podman build -t localhost/freeipa-server:${{ matrix.os }} -f Dockerfile.${{ matrix.os }} .
397
+ - name : Run master
398
+ run : docker=podman tests/run-master-and-replica.sh localhost/freeipa-server:${{ matrix.os }} && podman pod ls -q | xargs podman pod rm -f
399
+
0 commit comments