Make github actions for amd64 and arm64 (#201)
authorMontgomery Auber <redacted>
Sun, 29 Jan 2023 12:19:09 +0000 (14:19 +0200)
committerGitHub <redacted>
Sun, 29 Jan 2023 12:19:09 +0000 (13:19 +0100)
Merging PR for further development

.github/workflows/build.yml
tests/docker-compose.test-apache-postgres.yml
tests/docker-compose.test-fpm-postgres.yml

index 650f58ed5c856481c7d7c6610dc058e0619d68f3..5bb6b1ac693207346153b4e1371961757fa2b3de 100644 (file)
@@ -1,21 +1,26 @@
 name: Build Docker image
-
 on: [push, pull_request]
-
 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', test-files: ['apache-postgres'], docker-tag: 'roundcube-test-apache' }
-          - { variant: 'fpm', test-files: ['fpm-postgres'], docker-tag: 'roundcube-test-fpm' }
-          - { variant: 'fpm-alpine', test-files: ['fpm-postgres'], docker-tag: 'roundcube-test-fpm-alpine' }
+          - variant: 'apache'
+            test-files: 'apache-postgres'
+            docker-tag: roundcube/roundcubemail:latest,roundcube/roundcubemail:1.6.x-apache,roundcube/roundcubemail:1.6.0-apache,roundcube/roundcubemail:latest-apache
+          - variant: 'fpm'
+            test-files: 'fpm-postgres'
+            docker-tag: roundcube/roundcubemail:1.6.x-fpm,roundcube/roundcubemail:1.6.0-fpm,roundcube/roundcubemail:latest-fpm
+          - variant: 'fpm-alpine'
+            test-files: 'fpm-postgres'
+            docker-tag: roundcube/roundcubemail:1.6.x-fpm-alpine,roundcube/roundcubemail:1.6.0-fpm-alpine,roundcube/roundcubemail:latest-fpm-alpine
     steps:
       - name: Checkout repository
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
       - name: Get docker hub username
         id: creds
         run: echo '::set-output name=username::${{ secrets.DOCKER_PULL_USERNAME }}'
@@ -25,8 +30,22 @@ jobs:
         with:
           username: ${{ secrets.DOCKER_PULL_USERNAME }}
           password: ${{ secrets.DOCKER_PULL_PASSWORD }}
-      - name: Build image variant "${{ matrix.variant }}"
-        run: cd ${{ matrix.variant }} && docker buildx build ./ -t ${{ matrix.docker-tag }}
+
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v1
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v2
+        with:
+          buildkitd-flags: --debug
+
+      - name: Build and push image for "${{ matrix.variant }}"
+        uses: docker/build-push-action@v3
+        with:
+          context: ${{ matrix.variant }}
+          platforms: "linux/arm64,linux/arm/v6,linux/arm/v7,linux/s390x,linux/ppc64le,linux/386,linux/amd64,"
+          push: true 
+          tags: ${{ matrix.docker-tag }}
+          # does not work linux/arm/v5 AND linux/mips64le - composer does not support  mips64le or armv5 nor does the php image support them on the alpine variant
       - name: Run tests
         env:
           ROUNDCUBEMAIL_TEST_IMAGE: ${{ matrix.docker-tag }}
@@ -37,3 +56,5 @@ jobs:
             docker-compose -f ./tests/docker-compose.test-${testFile}.yml \
             up --exit-code-from=sut --abort-on-container-exit
           done
+          
+
index ac2fc33dc97845eb4f275ba1fd18d9eb7291e5dd..c6b11fe4b13c70f3305db8d2734156b8b9d9952d 100644 (file)
@@ -2,7 +2,7 @@ version: "2"
 
 services:
   roundcubemail:
-    image: ${ROUNDCUBEMAIL_TEST_IMAGE:-roundcube-test-apache}
+    image: roundcube/roundcubemail:1.6.0-apache
     healthcheck:
       # To make it obvious in logs "ping=ping" is added
       test: ["CMD", "curl", "--fail", "http://localhost/?ping=ping"]
index 638853b76d5b8d4db7f38ea8b6183fc4b1d6b29a..c377de129f5e124c5b1427f1014d1fe2c5813507 100644 (file)
@@ -2,7 +2,7 @@ version: "2"
 
 services:
   roundcubemail-fpm:
-    image: ${ROUNDCUBEMAIL_TEST_IMAGE:-roundcube-test-fpm}
+    image: roundcube/roundcubemail:1.6.0-fpm
     healthcheck:
       # Check until the FPM port is in in the LISTEN list
       # test: ["CMD-SHELL", "netstat -an | grep -q -F \":9000\""]
git clone https://git.99rst.org/PROJECT