From 2286d8a63b0575de29b0ac0f70697e27dde4f9dd Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Wed, 12 Nov 2025 14:16:01 -0500 Subject: [PATCH] feat: Test building with swift:slim, as a matrix strategy in ci. --- .gitea/workflows/ci.yaml | 6 ++++++ .gitea/workflows/release.yaml | 2 +- Dockerfile | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 30e829e..7d9ede9 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -15,6 +15,9 @@ env: # There is a single job in this workflow. It's configured to run on the latest available version of Ubuntu. jobs: build-and-push-image: + strategy: + matrix: + version: ["latest", "slim"] runs-on: ubuntu-latest # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job. permissions: @@ -48,6 +51,7 @@ jobs: tags: | type=ref,event=branch type=sha + type=raw,${{ matrix.version }} - name: Build and push Docker image id: push uses: docker/build-push-action@v6 @@ -55,5 +59,7 @@ jobs: context: . file: Dockerfile push: true + build-args: | + SWIFT_VERSION="swift:${{ matrix.version }}" tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index dbef8d5..a386f4b 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -50,7 +50,7 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} type=sha - type=raw,value=latest + type=raw,value=${{ matrix.version }} - name: Build and push Docker image id: push uses: docker/build-push-action@v6 diff --git a/Dockerfile b/Dockerfile index 79bf6d1..a84ee8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM docker.io/swift:latest AS build +ARG SWIFT_VERSION="swift:latest" + +FROM docker.io/${SWIFT_VERSION} AS build RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \ && apt-get -q update \ @@ -13,7 +15,7 @@ RUN rustup default stable && \ /root/.cargo/bin/bob install nightly && \ /root/.cargo/bin/bob use nightly -FROM docker.io/swift:latest +FROM docker.io/${SWIFT_VERSION} RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \ && apt-get -q update \