From 19dcbf30390f1fb840757832737f520670270c10 Mon Sep 17 00:00:00 2001 From: Kostas Kyrimis Date: Tue, 21 Apr 2026 11:41:39 +0300 Subject: [PATCH] chore: build and test images on push Signed-off-by: Kostas Kyrimis --- .github/workflows/docker-image.yml | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index dca6e8b..1b20002 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -3,6 +3,7 @@ name: Docker Image CI on: push: branches: [main, Pr1] + pull_request: workflow_dispatch: permissions: @@ -13,10 +14,65 @@ concurrency: cancel-in-progress: true jobs: + # =============================================================== + # PR check: build all images locally, no registry push + # =============================================================== + pr_check: + if: github.event_name == 'pull_request' + strategy: + max-parallel: 6 + matrix: + distro: + - name: "alpine-dev" + tag: latest + file: alpine-dev.Dockerfile + - name: "ubuntu-dev" + tag: 20-gcc14 + file: u20.04-gcc14-dev.Dockerfile + - name: "fedora" + tag: 30 + file: fedora30-dev.Dockerfile + - name: "fedora" + tag: 30-gcc14 + file: fedora30-gcc14-dev.Dockerfile + - name: "ubuntu-dev" + tag: 24 + file: u24.04-dev.Dockerfile + - name: "ubuntu-dev" + tag: 24-afl + file: u24.04-afl-dev.Dockerfile + - name: "fedora" + tag: 41 + file: fedora41-dev.Dockerfile + image: + - name: ubuntu-24.04 + arch: amd64 + - name: ubuntu-24.04-arm + arch: arm64 + + runs-on: ${{ matrix.image.name }} + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + + - name: Build + uses: docker/build-push-action@v6 + with: + context: . + provenance: false + platforms: linux/${{ matrix.image.arch }} + file: ${{ matrix.distro.file }} + load: true + tags: pr-test:${{ matrix.distro.name }}-${{ matrix.distro.tag }} + + - name: Test Docker image + run: docker run --rm "pr-test:${{ matrix.distro.name }}-${{ matrix.distro.tag }}" echo succeeded + # =============================================================== # Building Dev Image # =============================================================== build_dev: + if: github.event_name != 'pull_request' strategy: max-parallel: 6 matrix: