Repository navigation
Only test the PHP versions a PR changes - #53
Merged
Merged
Conversation
Every PR built and tested all versions in versions.json, so a change to one version's folder (such as #47, only 7.4/) also showed unrelated failures from other versions. On pull requests the matrix job now diffs the PR against its base. If every changed file is inside a version folder listed in versions.json, only those versions are tested. Any other change (common/, the workflow, the Makefile, versions.json, the README), an unknown folder, or a failed diff tests every version as before. Pushes to master are unchanged. Fixes #51 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uugex1w8qZoTbBRbcFwkcp
There was a problem hiding this comment.
🟡 Changes recommended
Rename detection can omit source paths, causing affected versions or shared-file changes to bypass required testing.
1 open issue
What changed in this PR
This PR narrows PHP test coverage to the versions changed by a pull request, addressing #51 and avoiding unrelated failures on version-specific changes such as #47.
Changes:
- Fetches full history and uses the PR diff to select affected versions from
versions.json. - Keeps all-version testing for shared or unknown paths, empty diffs, and diff failures.
- Logs selected versions while leaving the build matrix and master-push behavior unchanged.
| File | Description |
|---|---|
.github/workflows/build.yml |
Adds PR-specific test matrix selection and selection logging. |
Review effort: Balanced
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.

Summary
Fixes #51
Every PR tests all PHP versions, whatever it changes, so a PR that only touches one version's folder (for example #47, only
7.4/) runs every version's test and picks up unrelated failures. This makes PRs test only the versions they change.Notable Changes
matrixjob checks out withfetch-depth: 0and, on pull requests, runsgit diff --name-only base...head.versions.json, the test matrix keeps only those versions.common/, the workflow, the Makefile,versions.json, the README), a folder not inversions.json, or a failed diff tests every version, as now. The build matrix and pushes to master are unchanged.Testing: <versions>so the selection is visible in the job log.QA
Checked locally with the jq filter against
versions.json:7.4/...7.4/and8.3/7.4/pluscommon/php.batsversions.json9.9/This PR changes the workflow, so its own CI tests every version. After merge, #47's CI should run only the 7.4 test.
Deployment
None.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Uugex1w8qZoTbBRbcFwkcp