Skip to content

Commit 181247a

Browse files
phlogistonjohnobnoxxx
authored andcommitted
github: combine nightly jobs with default jobs using matrix
At this point the job definitions for build-nightly-* and test-nightly-* were nearly the same as the non-nightly counterparts. Combine the job definitions via a new matrix parameter. Signed-off-by: John Mulligan <[email protected]>
1 parent 093fd32 commit 181247a

File tree

1 file changed

+32
-105
lines changed

1 file changed

+32
-105
lines changed

.github/workflows/container-image.yml

Lines changed: 32 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,25 @@ jobs:
3636
run: make check-gitlint
3737

3838
build-server:
39+
# Reminder: the nightly-server images consume nightly samba rpm builds
40+
# it is not *just* an image that gets built nightly
3941
strategy:
4042
matrix:
43+
package_source: [default, nightly]
4144
os: [centos, fedora, opensuse]
4245
arch: [amd64]
46+
exclude:
47+
# there are no nightly packages for opensuse
48+
- package_source: nightly
49+
os: opensuse
4350
runs-on: ubuntu-latest
4451
env:
4552
BUILDAH_FORMAT: oci
46-
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
53+
IMG_TAG: ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
4754
steps:
4855
- uses: actions/checkout@v3
4956
- name: Build the server image
50-
run: make KIND=server OS_NAME=${{ matrix.os}} BUILD_ARCH=${{ matrix.arch}} build-image
57+
run: make KIND=server PACKAGE_SOURCE=${{ matrix.package_source }} OS_NAME=${{ matrix.os}} BUILD_ARCH=${{ matrix.arch}} build-image
5158
- name: Upload server image
5259
uses: ishworkh/[email protected]
5360
with:
@@ -58,18 +65,24 @@ jobs:
5865
build-ad-server:
5966
strategy:
6067
matrix:
68+
package_source: [default, nightly]
6169
os: [centos, fedora, opensuse]
6270
arch: [amd64]
6371
exclude:
64-
- os: centos
72+
# there are no nightly packages for opensuse
73+
- package_source: nightly
74+
os: opensuse
75+
# the distro packages for centos do not include an ad-dc
76+
- package_source: default
77+
os: centos
6578
runs-on: ubuntu-latest
6679
env:
6780
BUILDAH_FORMAT: oci
68-
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
81+
IMG_TAG: ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
6982
steps:
7083
- uses: actions/checkout@v3
7184
- name: Build the ad server image
72-
run: make KIND=ad-server OS_NAME=${{matrix.os}} BUILD_ARCH=${{matrix.arch}} build-image
85+
run: make KIND=ad-server PACKAGE_SOURCE=${{ matrix.package_source }} OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
7386
- name: Upload ad server image
7487
uses: ishworkh/[email protected]
7588
with:
@@ -130,13 +143,18 @@ jobs:
130143
test-server:
131144
strategy:
132145
matrix:
146+
package_source: [default, nightly]
133147
os: [centos, fedora, opensuse]
134148
arch: [amd64]
149+
exclude:
150+
# there are no nightly packages for opensuse
151+
- package_source: nightly
152+
os: opensuse
135153
needs: build-server
136154
runs-on: ubuntu-latest
137155
env:
138156
BUILDAH_FORMAT: oci
139-
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
157+
IMG_TAG: ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
140158
steps:
141159
- uses: actions/checkout@v3
142160
- name: Download server image
@@ -147,83 +165,27 @@ jobs:
147165
- name: Test the server image
148166
run: LOCAL_TAG=samba-server:${{ env.IMG_TAG }} tests/test-samba-container.sh
149167

150-
# Reminder: the nightly-server images consume nightly samba rpm builds
151-
# it is not *just* an image that gets built nightly
152-
build-nightly-server:
153-
strategy:
154-
matrix:
155-
os: [centos, fedora]
156-
arch: [amd64]
157-
runs-on: ubuntu-latest
158-
env:
159-
BUILDAH_FORMAT: oci
160-
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
161-
steps:
162-
- uses: actions/checkout@v3
163-
- name: Build the nightly server image
164-
run: make KIND=server PACKAGE_SOURCE=nightly OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
165-
- name: Upload nightly server image
166-
uses: ishworkh/[email protected]
167-
with:
168-
image: "samba-server:${{ env.IMG_TAG }}"
169-
container_engine: ${{ env.CONTAINER_CMD }}
170-
retention_days: 1
171-
172-
build-nightly-ad-server:
173-
strategy:
174-
matrix:
175-
os: [centos, fedora]
176-
arch: [amd64]
177-
runs-on: ubuntu-latest
178-
env:
179-
BUILDAH_FORMAT: oci
180-
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
181-
steps:
182-
- uses: actions/checkout@v3
183-
- name: Build the nightly ad server image
184-
run: make KIND=ad-server PACKAGE_SOURCE=nightly OS_NAME=${{ matrix.os }} BUILD_ARCH=${{ matrix.arch }} build-image
185-
- name: Upload nightly AD server image
186-
uses: ishworkh/[email protected]
187-
with:
188-
image: "samba-ad-server:${{ env.IMG_TAG }}"
189-
container_engine: ${{ env.CONTAINER_CMD }}
190-
retention_days: 1
191-
192-
test-nightly-server:
193-
strategy:
194-
matrix:
195-
os: [centos, fedora]
196-
arch: [amd64]
197-
needs: build-nightly-server
198-
runs-on: ubuntu-latest
199-
env:
200-
BUILDAH_FORMAT: oci
201-
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
202-
steps:
203-
- uses: actions/checkout@v3
204-
- name: Download nightly server image
205-
uses: ishworkh/[email protected]
206-
with:
207-
image: "samba-server:${{ env.IMG_TAG }}"
208-
container_engine: ${{ env.CONTAINER_CMD }}
209-
- name: Test the nightly server image
210-
run: LOCAL_TAG=samba-server:${{ env.IMG_TAG }} tests/test-samba-container.sh
211-
212168
test-ad-server-kubernetes:
213169
strategy:
214170
matrix:
171+
package_source: [default, nightly]
215172
os: [centos, fedora, opensuse]
216173
arch: [amd64]
217174
exclude:
218-
- os: centos
175+
# there are no nightly packages for opensuse
176+
- package_source: nightly
177+
os: opensuse
178+
# the distro packages for centos do not include an ad-dc
179+
- package_source: default
180+
os: centos
219181
needs:
220182
- build-ad-server
221183
- build-server
222184
# need to explicitly use 20.04 to avoid problems with jq...
223185
runs-on: ubuntu-20.04
224186
env:
225187
BUILDAH_FORMAT: oci
226-
IMG_TAG: default-${{ matrix.os }}-${{ matrix.arch }}
188+
IMG_TAG: ${{ matrix.package_source }}-${{ matrix.os }}-${{ matrix.arch }}
227189
steps:
228190
- uses: actions/checkout@v3
229191
- uses: nolar/setup-k3d-k3s@v1
@@ -244,48 +206,13 @@ jobs:
244206
- name: run the ad-dc deployment test
245207
run: ./tests/test-samba-ad-server-kubernetes.sh
246208

247-
test-nightly-ad-server-kubernetes:
248-
strategy:
249-
matrix:
250-
os: [centos, fedora]
251-
arch: [amd64]
252-
needs:
253-
- build-nightly-server
254-
- build-nightly-ad-server
255-
# need to explicitly use 20.04 to avoid problems with jq...
256-
runs-on: ubuntu-20.04
257-
env:
258-
BUILDAH_FORMAT: oci
259-
IMG_TAG: nightly-${{ matrix.os }}-${{ matrix.arch }}
260-
steps:
261-
- uses: actions/checkout@v3
262-
- uses: nolar/setup-k3d-k3s@v1
263-
- name: get nodes
264-
run: kubectl get nodes
265-
- name: Download nightly ad server image
266-
uses: ishworkh/[email protected]
267-
with:
268-
image: "samba-ad-server:${{ env.IMG_TAG }}"
269-
container_engine: ${{ env.CONTAINER_CMD }}
270-
- name: Download nightly file server image
271-
uses: ishworkh/[email protected]
272-
with:
273-
image: "samba-server:${{ env.IMG_TAG }}"
274-
container_engine: ${{ env.CONTAINER_CMD }}
275-
- name: import images to k3d
276-
run: k3d image import samba-server:${{ env.IMG_TAG }} samba-ad-server:${{ env.IMG_TAG }}
277-
- name: run the ad-dc deployment test
278-
run: ./tests/test-samba-ad-server-kubernetes.sh
279-
280209
push:
281210
# verify it passes the test jobs first
282211
needs:
283212
- build-client
284213
- build-toolbox
285214
- test-server
286-
- test-nightly-server
287215
- test-ad-server-kubernetes
288-
- test-nightly-ad-server-kubernetes
289216
runs-on: ubuntu-latest
290217
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.repository == 'samba-in-kubernetes/samba-container'
291218
steps:

0 commit comments

Comments
 (0)