Skip to content

Commit 5aa05ff

Browse files
committed
Build the Docker images for systemtest
Signed-off-by: Benoit Donneaux <benoit@leastauthority.com>
1 parent 533f5e9 commit 5aa05ff

File tree

1 file changed

+82
-11
lines changed

1 file changed

+82
-11
lines changed

.github/workflows/ci.yml

Lines changed: 82 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -242,28 +242,99 @@ jobs:
242242
name: integration.eliot.json
243243
path: integration.eliot.json
244244

245+
build-images:
246+
runs-on: ubuntu-22.04
247+
strategy:
248+
fail-fast: false
249+
matrix:
250+
image:
251+
- distro: "debian"
252+
tag: "11"
253+
python-version: "3.9"
254+
- distro: "ubuntu"
255+
tag: "20.04"
256+
python-version: "3.9"
257+
- distro: "ubuntu"
258+
tag: "22.04"
259+
python-version: "3.10"
260+
- distro: "fedora"
261+
tag: "35"
262+
python-version: "3.10"
263+
- distro: "oraclelinux"
264+
tag: "8"
265+
python-version: "3.9"
266+
env:
267+
TAG: ${{ matrix.image.tag }}
268+
PYTHON_VERSION: ${{ matrix.image.python-version }}
269+
DISTRO: ${{ matrix.image.distro }}
270+
steps:
271+
- name: Checkout
272+
id: checkout
273+
uses: actions/checkout@v4
274+
with:
275+
fetch-depth: 0
276+
277+
- name: Verify Docker
278+
id: verify_docker
279+
run: |
280+
docker run --rm hello-world:latest > /dev/null
281+
docker rmi hello-world:latest > /dev/null
282+
docker version
283+
284+
- name: Cache docker images
285+
uses: ScribeMD/docker-cache@0.3.3
286+
with:
287+
key: |
288+
docker-${{ matrix.image.distro }}_${{ matrix.image.tag }}-py${{ matrix.image.python-version }}-${{ hashFiles(
289+
format('docker/{0}/Dockerfile', matrix.image.distro)
290+
) }}
291+
292+
- name: Build Docker image
293+
id: build_image
294+
run: |
295+
docker images --filter "reference=*tahoelafsci/${DISTRO}"
296+
docker images --filter "reference=*tahoelafsci/${DISTRO}:${TAG}-py${PYTHON_VERSION}" --quiet | grep -v "^$" \
297+
|| docker \
298+
build \
299+
--build-arg TAG=${TAG} \
300+
--build-arg PYTHON_VERSION=${PYTHON_VERSION} \
301+
-t tahoelafsci/${DISTRO}:${TAG}-py${PYTHON_VERSION} \
302+
-f ./docker/${DISTRO}/Dockerfile \
303+
. \
304+
&& docker images --filter "reference=*tahoelafsci/${DISTRO}"
305+
245306
systemtest:
246307
runs-on: ubuntu-22.04
247308
strategy:
248309
fail-fast: false
249310
matrix:
250311
image:
251-
- "debian:11"
252-
- "ubuntu:20.04"
253-
- "ubuntu:22.04"
254-
- "fedora:35"
255-
- "oraclelinux:8"
256-
python-version:
257-
- 3.9
312+
- distro: "debian"
313+
tag: "11"
314+
python-version: "3.9"
315+
- distro: "ubuntu"
316+
tag: "20.04"
317+
python-version: "3.9"
318+
- distro: "ubuntu"
319+
tag: "22.04"
320+
python-version: "3.10"
321+
- distro: "fedora"
322+
tag: "35"
323+
python-version: "3.10"
324+
- distro: "oraclelinux"
325+
tag: "8"
326+
python-version: "3.9"
327+
env:
328+
TAG: ${{ matrix.image.tag }}
329+
PYTHON_VERSION: ${{ matrix.image.python-version }}
330+
DISTRO: ${{ matrix.image.distro }}
258331
container:
259-
image: ${{ matrix.image }}
332+
image: ${{ matrix.image.distro }}
260333
options: --cpus 1
261-
env:
262-
python-version: ${{ matrix.python-version }}
263334
steps:
264335
- name: Test image
265336
run: |
266-
echo "${{ matrix.image }}-${{ env.python-version }}"
337+
echo "${DISTRO}:${TAG}-py${PYTHON_VERSION}"
267338
268339
packaging:
269340
if: ${{ false }}

0 commit comments

Comments
 (0)