Build 1.5-images regularly – if tests succeed
authorPablo Zmdl <redacted>
Wed, 4 Jun 2025 09:44:44 +0000 (11:44 +0200)
committerPablo Zmdl <redacted>
Wed, 4 Jun 2025 09:50:41 +0000 (11:50 +0200)
The images for 1.5.x don't include stages, so currently it's easier to
build them in a new workflow. We'll change that someday, probably.

.github/workflows/build-1.5.yml [new file with mode: 0644]
.github/workflows/build.yml

diff --git a/.github/workflows/build-1.5.yml b/.github/workflows/build-1.5.yml
new file mode 100644 (file)
index 0000000..1f528c1
--- /dev/null
@@ -0,0 +1,87 @@
+name: Build & Publish 1.5.x
+
+permissions:
+  contents: read
+
+on:
+  push:
+    branches:
+      - 'master'
+    paths:
+      - 'apache-1.5.x/**'
+      - 'fpm-1.5.x/**'
+      - 'fpm-alpine-1.5.x/**'
+
+  schedule:
+    # Rebuild images each monday early morning to ensure a fresh base OS.
+    - cron: "23 2 * * 1"
+  workflow_dispatch:
+
+jobs:
+  build-and-testvariants:
+    name: Build image variants and run tests
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      max-parallel: 10
+      matrix:
+        include:
+          - variant: 'apache-1.5.x'
+            test-files: 'apache-postgres'
+            docker-tag: roundcube/roundcubemail:1.5.x-apache,roundcube/roundcubemail:1.5.10-apache,roundcube/roundcubemail:latest-apache,roundcube/roundcubemail:latest
+            test-tag: roundcube/roundcubemail:latest-apache
+          - variant: 'fpm'
+            test-files: 'fpm-postgres-1.5.x'
+            docker-tag: roundcube/roundcubemail:1.5.x-fpm,roundcube/roundcubemail:1.5.10-fpm,roundcube/roundcubemail:latest-fpm
+            test-tag: roundcube/roundcubemail:latest-fpm
+          - variant: 'fpm-alpine-1.5.x'
+            test-files: 'fpm-postgres'
+            docker-tag: roundcube/roundcubemail:1.5.x-fpm-alpine,roundcube/roundcubemail:1.5.10-fpm-alpine,roundcube/roundcubemail:latest-fpm-alpine
+            test-tag: roundcube/roundcubemail:latest-fpm-alpine
+    steps:
+      - name: Checkout repository
+        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+      - name: Get docker hub username
+        id: creds
+        run: echo '::set-output name=username::${{ secrets.DOCKER_PULL_USERNAME }}'
+      - name: Login to Docker Hub
+        if: steps.creds.outputs.username != ''
+        uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
+        with:
+          username: ${{ secrets.DOCKER_PULL_USERNAME }}
+          password: ${{ secrets.DOCKER_PUSH_PASSWORD }}
+
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
+        with:
+          buildkitd-flags: --debug
+
+      - name: Build locally native image for "${{ matrix.variant }} for tests"
+        uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
+        with:
+          context: ${{ matrix.variant }}
+          push: load
+          tags: ${{ matrix.docker-tag }}
+
+      - name: Run tests
+        env:
+          # ROUNDCUBEMAIL_TEST_IMAGE: roundcube/roundcubemail:latest-${{matrix.variant}}
+          ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.test-tag }}
+          HTTP_PORT: ${{ matrix.http-port || '80' }}
+        run: |
+          set -exu;
+          for testFile in ${{ join(matrix.test-files, ' ') }};
+          do
+            docker compose -f ./tests/docker-compose.test-${testFile}.yml \
+            up --exit-code-from=sut --abort-on-container-exit
+          done
+
+      - name: Build and push all images for "${{ matrix.variant }}"
+        uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
+        with:
+          context: ${{ matrix.variant }}
+          platforms: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/386,linux/amd64"
+          push: true
+          tags: ${{ matrix.docker-tag }}
index ad4b8acefabe25d3fbce38d19a0aaae53a2224cc..7e2698b2e721ad7572e1c495d262abdf369f5636 100644 (file)
@@ -10,6 +10,9 @@ on:
     paths-ignore:
       - 'README.md'
       - 'examples/**'
+      - 'apache-1.5.x/**'
+      - 'fpm-1.5.x/**'
+      - 'fpm-alpine-1.5.x/**'
     tags:
       - '1.6.*'
   schedule:
git clone https://git.99rst.org/PROJECT