Skip to content

Conversation

@M4dhav
Copy link

@M4dhav M4dhav commented Dec 6, 2025

This PR Fixes #33

Summary by CodeRabbit

  • Chores
    • Implemented comprehensive multi-platform continuous integration and testing infrastructure to enable systematic validation across multiple CPU architectures and diverse deployment environments
    • Enhanced Docker build process and container image management pipeline with platform-specific tagging conventions, automated environment configuration, and improved deployment consistency for reliable cross-platform deployments

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 6, 2025

Walkthrough

The pull request introduces multi-platform testing support in the GitHub Actions workflow by implementing a matrix strategy covering amd64, arm64, arm/v7, and ppc64le architectures. The workflow now derives environment variables from the matrix platform, installs dependencies, configures QEMU for cross-platform emulation, and builds Docker images with platform-specific tags targeting linux/\{matrix.platform\}. Test dispatch logic is updated to use matrix-platform-specific branches instead of architecture detection. Additionally, docker-compose.yml is modified to include an explicit image directive for the tests service, referencing a platform-derived tag (database-dev:\${PLATFORM}).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–25 minutes

  • GitHub Actions workflow matrix implementation: Verify that all four platforms (amd64, arm64, arm/v7, ppc64le) are correctly configured, QEMU setup is appropriate for each platform, and Docker image tagging aligns with platform specifications.
  • Test dispatch logic: Confirm that the mapping between matrix.platform branches and PHPunit test suites (X86, ARM64, ARMV7, PPC) is accurate and complete.
  • docker-compose.yml integration: Ensure the image directive with \${PLATFORM} variable correctly resolves and works with the workflow's platform-specific builds.
  • Environment variable consistency: Verify that PLATFORM environment variable derivation is consistent across workflow steps and properly used in docker-compose.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: fixing the test workflow and adding support for multiple platforms (amd64, arm64, arm/v7, ppc64le).
Linked Issues check ✅ Passed The PR successfully addresses issue #33 by implementing a matrix-driven workflow that dispatches tests by platform branches instead of relying on arch detection, ensuring PHPUnit tests execute on ubuntu-latest.
Out of Scope Changes check ✅ Passed All changes are in-scope: workflow file modifications fix the arch-detection issue and add platform support, while docker-compose.yml changes support the new platform-based testing architecture.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +8 to +10
strategy:
matrix:
platform: [amd64, arm64, arm/v7, ppc64le]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added parallel running and more platforms to the workflow

Comment on lines +12 to +13
env:
PLATFORM: ${{ matrix.platform == 'arm/v7' && 'armv7' || matrix.platform }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting an env for use by docker-compose

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should matrix platform just be armv7 so we dont have to add this check for it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The platform param under the build-push-action expects linux/arm/v7 and will not work with armv7.

We could set it as armv7 and add a check there to set it as arm/v7 if that would be preferred

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err ok, this is fine for now

Comment on lines +24 to +25
- name: Install dependencies
run: composer install --ignore-platform-reqs --no-interaction --prefer-dist
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Installing composer dependencies before is necessary because of how the container volumes are mounted by docker-compose

Comment on lines +28 to +30
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting up Qemu to run other platforms on an amd64 machine

Comment on lines +34 to +43
- 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 }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditionally spin up instances for specific architectures

context: .
push: false
tags: database-dev
tags: database-dev:${{ matrix.platform == 'arm/v7' && 'armv7' || matrix.platform }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tags cannot have slashes so added a special check

tests:
build:
context: .
image: database-dev:${PLATFORM}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Necessary to ensure docker always builds the container with the right architecture

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is PLATFORM set here? should there be a fallback?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compose fetches PLATFORM from env variables, which are set in the workflow. No matter what strategy is running, an env var will aways be set, so the fallback is intrinsic. The same var is used as the tag while building the containers so the compose step will never fail

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if i run docker compose locally

Copy link
Author

@M4dhav M4dhav Dec 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will have to set the env var and build the container with the correct tag. If you would prefer another approach, I can duplicate the compose and make one specifically for CI that is used in the CI and keep the default compose unchanged

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah either works, as long as we dont break local setup without extra steps

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6441a9c and c73d6c1.

📒 Files selected for processing (2)
  • .github/workflows/tests.yml (3 hunks)
  • docker-compose.yml (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.9)
.github/workflows/tests.yml

32-32: the runner of "docker/setup-buildx-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


35-35: the runner of "docker/build-push-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🔇 Additional comments (2)
docker-compose.yml (1)

7-7: Verify PLATFORM variable is exported and image exists.

The image directive depends on the PLATFORM environment variable being available when docker compose runs. Ensure that the workflow properly exports this variable. Additionally, this directive assumes the Docker image was successfully built and loaded—which has implications for multi-platform testing (see critical issue in the workflow file).

.github/workflows/tests.yml (1)

51-60: Test dispatch logic is sound, but depends on above fixes.

The conditional checks on matrix.platform (lines 52–59) correctly replace the broken architecture detection from issue #33. Each platform dispatches to the appropriate PHPUnit test suite. However, this logic will only execute if the Docker image successfully loads and containers start (see critical issue in lines 34–43).

Once the multi-platform docker build issue is resolved, verify that the test suites X86, ARM64, ARMV7, and PPC are properly defined in phpunit.xml and that test execution completes without error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests Workflow is broken

2 participants