The test framework has been updated to address this!If I may offer my 2 cents on the PR...PHP_VERSION
andPHP_VERSIONS
, although that very similar naming might be confusing.
Thanks for the effort on this though!
TL;DR:
In our reusable GitHub Action, we define two PHP version settings:
PRIMARY_PHP_VERSION
used for single-version tests (like EPV, MSSQL, SQLite, Windows)PHP_VERSION_MATRIX
used for running the full test matrix (MySQL/MariaDB and PostgreSQL)
The default values are:
Code:
PRIMARY_PHP_VERSION: '7.2'PHP_VERSION_MATRIX: '["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"]'
Code:
PRIMARY_PHP_VERSION: '8.0'PHP_VERSION_MATRIX: '["8.0", "8.1", "8.2", "8.3", "8.4"]'
GitHub Actions doesn’t let you treat the version matrix as a typical array—so you can’t just grab the “first” entry dynamically. That means we need to manually define a “primary” PHP version for tests that are only meant to run once, not across every PHP version.
Why does that matter? Because running all tests across all PHP versions would be total overkill. For example, some tests like EPV (Extension PreValidator) only need to run against one PHP version. If we tried to run them against every version in the matrix, we’d end up with 100s of jobs per run!
So, we use the PHP version matrix only for the core database tests (MySQL/MariaDB and PostgreSQL). All other tests—like MSSQL, SQLite, and Windows—run on a single, defined PHP version.
How to Set PHP Versions for Your Extension
The default values are the same PHP versions phpBB is tested against. So most extensions should never need to set these variables. But for those extensions that do have stricter PHP version requirements than phpBB, here are a couple of common scenarios for choosing your PHP version strategy:
Scenario 1: Your extension supports only PHP 8.1+
Let’s say you’re using modern, non-backwards-compatible features.
Code:
PRIMARY_PHP_VERSION: '8.1'PHP_VERSION_MATRIX: '["8.1", "8.2", "8.3", "8.4"]'
- The matrix should include all versions you support
- The primary PHP version is usually the first in that list (but you can choose any supported version)
If you’re sticking with phpBB’s full support range but you’d prefer EPV and other single-version tests to run on PHP 8 instead of the default 7.2:
Code:
PRIMARY_PHP_VERSION: '8.4'
PHP_VERSION_MATRIX
here—it will default to ["7.2", ..., "8.4"]. This approach lets you nudge the single-version tests toward your preferred PHP version without affecting the full compatibility matrix.Statistics: Posted by MattF — Sun May 04, 2025 4:23 pm