PHPLARA-258 Mutualize PHP + MongoDB extension setup in CI - #3562
Merged
Conversation
Add a composite action .github/actions/setup-php that resolves the latest stable mongodb PHP extension for a given driver major via the GitHub API, then chains cache-extensions + actions/cache + setup-php. The actions/cache step was missing in build-ci.yml, build-ci-atlas.yml and static-analysis.yml, so the extension was recompiled on every run. Routing all workflows through the composite action fixes that and keeps the resolved version fresh without hardcoded env vars.
There was a problem hiding this comment.
Pull request overview
This PR refactors GitHub Actions CI workflows to centralize PHP + MongoDB extension installation (including extension version resolution and caching) into a reusable composite action at .github/actions/setup-php, improving CI consistency and performance.
Changes:
- Added a composite action to resolve the latest stable
mongodbPHP extension for a given major (1 or 2) and install it with caching. - Updated CI workflows to use the composite action and removed now-obsolete env-based extension/version configuration.
- Improved Atlas Local readiness waiting logic and added a timeout to the replica-set bootstrap step.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| .github/actions/setup-php/action.yml | New composite action to resolve mongodb extension version and install/cached-build it via setup-php + cache-extensions + actions/cache. |
| .github/workflows/build-ci.yml | Switches test matrix to use composite setup-php action and adds a timeout to replica set creation. |
| .github/workflows/build-ci-atlas.yml | Uses composite setup-php action and adjusts Atlas Local readiness loops. |
| .github/workflows/static-analysis.yml | Uses composite setup-php action for PHPStan runs and removes old env-based extension configuration. |
| .github/workflows/coding-standards.yml | Uses composite setup-php action for PHPCS workflow and removes old driver env config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
GromNaN
commented
Aug 3, 2026
| - php: '8.2' | ||
| laravel: 12.* | ||
| mongodb: '4.4' | ||
| driver: 2 |
Member
Author
There was a problem hiding this comment.
We will remove this option when removing support for v1.x PHPLARA-255
kevinAlbs
approved these changes
Aug 3, 2026
GromNaN
added a commit
to zigzagdev/laravel-mongodb
that referenced
this pull request
Aug 24, 2026
* PHPLARA-258 mutualize PHP + MongoDB extension setup in CI Add a composite action .github/actions/setup-php that resolves the latest stable mongodb PHP extension for a given driver major via the GitHub API, then chains cache-extensions + actions/cache + setup-php. The actions/cache step was missing in build-ci.yml, build-ci-atlas.yml and static-analysis.yml, so the extension was recompiled on every run. Routing all workflows through the composite action fixes that and keeps the resolved version fresh without hardcoded env vars. * PHPLARA-258 set driver=2 on matrix include entries * PHPLARA-258 harden MongoDB startup in CI (wait for primary, timeouts) * PHPLARA-258 address Copilot review (paginate releases, drop redundant collection) * PHPLARA-258 resolve mongodb release via GraphQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
untilloops to wait for the MongoDB cluster to be ready, to reduce recurring startup failures.Ref: https://jira.mongodb.org/browse/PHPLARA-258