Skip to content

Test against the whole supported range, not one combination - #5

Merged
stromcom merged 1 commit into
masterfrom
ci/test-matrix
Aug 14, 2026
Merged

Test against the whole supported range, not one combination#5
stromcom merged 1 commit into
masterfrom
ci/test-matrix

Conversation

@stromcom

Copy link
Copy Markdown
Owner

Why

The Tests workflow ran exactly one combination: PHP 8.2 with composer.lock. But composer.json accepts php: ^8.2 and tuupola/base62: ^2.1, so almost everything a consumer can resolve to was never executed — newer PHP, newer dependencies, and above all the lower bounds. A ^ constraint that is too loose is invisible until someone installs the oldest allowed version, and nothing here would have caught it.

What

php-unit.yml gets a 9-cell matrix — PHP 8.2 / 8.3 / 8.4 / 8.5 × dependencies locked / highest, plus lowest on the minimum PHP:

variant install what it proves
locked composer install the combination developers actually run
highest composer update an upstream release has not broken us
lowest composer update --prefer-lowest --prefer-stable the declared lower bounds are real

lowest runs on PHP 8.2 only — pairing the oldest dev tooling with the newest PHP tests the tooling, not this library. fail-fast: false, so one bad cell does not hide the rest, and the cache key and concurrency group now include the matrix values.

php-stan.yml stays single-version, with a comment saying why: PHPStan and php-cs-fixer judge the source, not the runtime, so four PHP versions would repeat one verdict.

Verified locally

composer update --prefer-lowest --prefer-stable resolves tuupola/base62 to 2.1.0; all 139 tests pass against it.

One finding worth acting on separately: tuupola/base62 2.1.0 triggers a PHP 8.5 deprecation (Non-canonical cast (integer) is deprecated, BaseEncoder.php:154), fixed in the locked 2.1.1. The matrix does not go red — lowest runs on 8.2, and there is no failOnDeprecation — but ^2.1 does let a consumer on PHP 8.5 resolve to a version that warns. Tightening the constraint to ^2.1.1 would close that; happy to do it in a follow-up.

CI ran a single cell: PHP 8.2 with composer.lock. composer.json allows
PHP ^8.2 and tuupola/base62 ^2.1, so most of what consumers can resolve
to was never executed -- including the lower bounds, which is where an
overly loose constraint hides.

Adds a 9-cell matrix: PHP 8.2-8.5 x (locked, highest), plus prefer-lowest
on the minimum PHP. Code quality stays single-version and says why.
@stromcom
stromcom merged commit dffe73c into master Aug 14, 2026
10 checks passed
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