Skip to content

Commit 9810dee

Browse files
workflows: simply workflow with a matrix
Use a matrix to determine base distros for each job and use that to select a base container image. Signed-off-by: John Mulligan <[email protected]>
1 parent a63c765 commit 9810dee

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,24 @@ jobs:
2525
run: tox -e gitlint
2626
test:
2727
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
test_distro: ["fedora-37", "fedora-38", "centos-stream9"]
31+
include:
32+
- test_distro: "fedora-37"
33+
base_image: "registry.fedoraproject.org/fedora:37"
34+
- test_distro: "fedora-38"
35+
base_image: "registry.fedoraproject.org/fedora:38"
36+
- test_distro: "centos-stream9"
37+
base_image: "quay.io/centos/centos:stream9"
2838
steps:
2939
- uses: actions/checkout@v3
3040
with:
3141
fetch-depth: 0
3242
- name: Build test container
33-
run: docker build -t sambacc:ci tests/container/ -f tests/container/Containerfile
43+
run: docker build -t sambacc:ci-${{ matrix.test_distro }} --build-arg=SAMBACC_BASE_IMAGE=${{ matrix.base_image }} tests/container/ -f tests/container/Containerfile
3444
- name: Run test container
35-
run: docker run -v $PWD:/var/tmp/build/sambacc sambacc:ci
36-
test-centos-stream9:
37-
runs-on: ubuntu-latest
38-
steps:
39-
- uses: actions/checkout@v3
40-
with:
41-
fetch-depth: 0
42-
- name: Build test container
43-
run: docker build --build-arg=SAMBACC_BASE_IMAGE=quay.io/centos/centos:stream9 -t sambacc:ci-cs9 tests/container/ -f tests/container/Containerfile
44-
- name: Run test container
45-
run: docker run -v $PWD:/var/tmp/build/sambacc sambacc:ci-cs9
46-
test-fedora37:
47-
runs-on: ubuntu-latest
48-
steps:
49-
- uses: actions/checkout@v3
50-
with:
51-
fetch-depth: 0
52-
- name: Build test container
53-
run: docker build --build-arg=SAMBACC_BASE_IMAGE=registry.fedoraproject.org/fedora:37 -t sambacc:ci-fc37 tests/container/ -f tests/container/Containerfile
54-
- name: Run test container
55-
run: docker run -v $PWD:/var/tmp/build/sambacc sambacc:ci-fc37
45+
run: docker run -v $PWD:/var/tmp/build/sambacc sambacc:ci-${{ matrix.test_distro }}
5646

5747
push:
5848
needs: [test]

0 commit comments

Comments
 (0)