From c73d6c130ba62584577af072df2c2d53325b7361 Mon Sep 17 00:00:00 2001 From: Madhav Gupta Date: Sat, 6 Dec 2025 12:59:30 +0530 Subject: [PATCH] fix: Fix test workflow and add more platforms --- .github/workflows/tests.yml | 29 +++++++++++++++++++++++------ docker-compose.yml | 1 + 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d0f2802..93a35ea 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,6 +5,12 @@ jobs: tests: name: Unit & E2E runs-on: ubuntu-latest + strategy: + matrix: + platform: [amd64, arm64, arm/v7, ppc64le] + + env: + PLATFORM: ${{ matrix.platform == 'arm/v7' && 'armv7' || matrix.platform }} steps: - name: Checkout repository @@ -14,19 +20,27 @@ jobs: submodules: recursive - run: git checkout HEAD^2 + + - name: Install dependencies + run: composer install --ignore-platform-reqs --no-interaction --prefer-dist + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - - name: Build image + - name: Build image for ${{ matrix.platform }} uses: docker/build-push-action@v3 with: context: . push: false - tags: database-dev + tags: database-dev:${{ matrix.platform == 'arm/v7' && 'armv7' || matrix.platform }} load: true cache-from: type=gha cache-to: type=gha,mode=max + platforms: linux/${{ matrix.platform }} - name: Start Containers run: | @@ -35,9 +49,12 @@ jobs: - name: Run Tests run: | - arch=$(uname -m) - if [ "${arch}" = "amd64" ]; then + if [[ "${{ matrix.platform }}" == "amd64" ]]; then docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite X86; - elif [ "${arch}" = "arm64" ] || [ "${arch}" = "aarch64" ]; then - docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite ARM64; + elif [[ "${{ matrix.platform }}" == "arm64" ]]; then + docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite ARM64; + elif [[ "${{ matrix.platform }}" == "arm/v7" ]]; then + docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite ARMV7; + elif [[ "${{ matrix.platform }}" == "ppc64le" ]]; then + docker compose exec tests vendor/bin/phpunit --configuration phpunit.xml --testsuite PPC; fi \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 491eef6..cefda40 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,7 @@ services: tests: build: context: . + image: database-dev:${PLATFORM} mem_limit: 512m mem_reservation: 128M cpus: 0.5