@@ -242,28 +242,97 @@ 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+
275+ - name : Verify Docker
276+ id : verify_docker
277+ run : |
278+ docker run --rm hello-world:latest > /dev/null
279+ docker rmi hello-world:latest > /dev/null
280+ docker version
281+
282+ - name : Cache docker images
283+ uses : ScribeMD/docker-cache@0.3.3
284+ with :
285+ key : |
286+ docker-${{ matrix.image.distro }}_${{ matrix.image.tag }}-py${{ matrix.image.python-version }}-${{ hashFiles(
287+ format('docker/{0}/Dockerfile', matrix.image.distro)
288+ ) }}
289+
290+ - name : Build Docker image
291+ id : build_image
292+ run : |
293+ docker images --filter "reference=*tahoelafsci/${DISTRO}"
294+ docker images --filter "reference=*tahoelafsci/${DISTRO}:${TAG}-py${PYTHON_VERSION}" --quiet | grep -v "^$" \
295+ || docker \
296+ build \
297+ --build-arg TAG=${TAG} \
298+ --build-arg PYTHON_VERSION=${PYTHON_VERSION} \
299+ -t tahoelafsci/${DISTRO}:${TAG}-py${PYTHON_VERSION} \
300+ -f ./docker/${DISTRO}/Dockerfile \
301+ . \
302+ && docker images --filter "reference=*tahoelafsci/${DISTRO}"
303+
245304 systemtest :
246305 runs-on : ubuntu-22.04
247306 strategy :
248307 fail-fast : false
249308 matrix :
250309 image :
251- - " debian:11"
252- - " ubuntu:20.04"
253- - " ubuntu:22.04"
254- - " fedora:35"
255- - " oraclelinux:8"
256- python-version :
257- - 3.9
310+ - distro : " debian"
311+ tag : " 11"
312+ python-version : " 3.9"
313+ - distro : " ubuntu"
314+ tag : " 20.04"
315+ python-version : " 3.9"
316+ - distro : " ubuntu"
317+ tag : " 22.04"
318+ python-version : " 3.10"
319+ - distro : " fedora"
320+ tag : " 35"
321+ python-version : " 3.10"
322+ - distro : " oraclelinux"
323+ tag : " 8"
324+ python-version : " 3.9"
325+ env :
326+ TAG : ${{ matrix.image.tag }}
327+ PYTHON_VERSION : ${{ matrix.image.python-version }}
328+ DISTRO : ${{ matrix.image.distro }}
258329 container :
259- image : ${{ matrix.image }}
330+ image : ${{ matrix.image.distro }}
260331 options : --cpus 1
261- env :
262- python-version : ${{ matrix.python-version }}
263332 steps :
264333 - name : Test image
265334 run : |
266- echo "${{ matrix.image }}-${{ env.python-version } }"
335+ echo "${DISTRO}:${TAG}-py${PYTHON_VERSION }"
267336
268337 packaging :
269338 if : ${{ false }}
0 commit comments