Skip to content

Add GitHub Actions CI with a PHP version matrix - #6

Merged
TomK merged 3 commits into
masterfrom
ci-actions-matrix
Sep 4, 2026
Merged

Add GitHub Actions CI with a PHP version matrix#6
TomK merged 3 commits into
masterfrom
ci-actions-matrix

Conversation

@TomK

@TomK TomK commented Sep 3, 2026

Copy link
Copy Markdown
Member

This repo had no CI at all — no Actions, no CircleCI. Adds a setup-php workflow matching packaged/dal's shape, with fail-fast: false.

Two things came out of getting it running, both pre-existing:

The matrix is 8.2 only, not dal's 8.0–8.2. composer.json says ^8.0, but symfony/http-foundation ^v7.2.0 resolves to 7.4.x, which requires PHP >= 8.2. I pushed 8.0 and 8.1 legs first and both died at composer install. The declared floor is already false; bumping it to ^8.2 is the honest fix but it's a packaging call, so composer.json is untouched. packaged/routing (#7) hits this through the same chain.

The 8.2 leg is red, and that's the point. LinkBuilderTest::testAsUrl expects setPort('443') on an https URL to drop the default port; asUrl() now emits https://secure.cubex.com:443/order. With no lockfile the transitive resolve moved under the repo and nothing was watching. Either LinkBuilder should suppress default ports again or the expectation is stale — a separate change. Merging the workflow is what makes it visible.

Test plan

Fresh composer install plus the full suite on PHP 8.2.33 from a clean checkout of master: 43 tests, 136 assertions, the one failure above and nothing else. Same single failure with the in-progress packaged/helpers ^3.0 bump applied locally, so it's unrelated to that work. The 8.2 leg on this PR reproduces it exactly.

🤖 Generated with Claude Code

@TomK
TomK force-pushed the ci-actions-matrix branch 2 times, most recently from f5136ac to c68bd75 Compare September 3, 2026 13:56
TomK and others added 2 commits September 4, 2026 09:56
#3 tightened the standard-port comparisons from == to ===, in both
Request::isStandardPort() and LinkBuilder::_isStandardPort(). Neither
receives a reliably-typed port, so the strict comparison silently stopped
matching:

 - LinkBuilder::setPort() is documented "mixed" and callers pass strings.
   setPort('443') on an https URL emitted https://host:443/path instead of
   https://host/path. setPort(443) worked, which is why only one assertion
   in LinkBuilderTest caught it.

 - Symfony's Request::getPort() returns int|string|null. With no HOST header
   it returns SERVER_PORT verbatim, which the SAPI provides as a string, so
   isStandardPort() returned false for a genuinely standard port and
   urlSprintf("%o") appended ":80" / ":443" to generated URLs.

Cast to int before comparing, in both places. The strict comparison stays,
so a non-numeric port still does not count as standard.

Adds coverage for the string-typed port on both paths -- LinkBuilder via
setPort('80') and Request via SERVER_PORT with the HOST header removed.
Both new assertions fail without this change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds a setup-php matrix over 8.2, 8.3, 8.4 and 8.5, with fail-fast disabled so
every leg reports independently. This repo had no CI of any kind.

The matrix starts at 8.2 rather than dal's 8.0. composer.json claims
"php": "^8.0", but symfony/http-foundation ^v7.2.0 resolves to 7.4.x, which
requires PHP >= 8.2, so composer cannot install on 8.0 or 8.1 -- verified by
those legs failing on an earlier push of this branch. Bumping the declared
floor to ^8.2 would make composer.json honest, but that is a packaging
decision and is left alone.

Note that the suite is red on master: LinkBuilderTest::testAsUrl expects
setPort('443') on an https URL to drop the default port, and asUrl() now
emits it. That predates this change and reproduces on every PHP version in
the matrix, so it is left for a separate fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@TomK
TomK force-pushed the ci-actions-matrix branch from c68bd75 to 543cd70 Compare September 4, 2026 08:56
@TomK

TomK commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

Stacked on #7 (the default-port fix) so the matrix has something green to prove. Merge #7 first, then this — I'll rebase it back onto a clean master if you'd rather review the workflow on its own.

@TomK
TomK merged commit 5065aeb into master Sep 4, 2026
4 checks passed
@TomK
TomK deleted the ci-actions-matrix branch September 4, 2026 14:06
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.

1 participant