Shared GitHub Actions for the Testo ecosystem. Each
action lives in its own directory and is referenced as php-testo/actions/<name>@<ref>.
Downgrades PHP sources in place to a target version, so a codebase written for a newer PHP can be exercised on an older runtime in CI. The transform runs before anything loads the code — install dependencies, downgrade, then run the suite as usual.
Rector is installed into a throwaway directory with its own composer.json; the project's
composer.json and vendor/ are never touched, and its autoloader is never booted. That
last point matters: a Rector installed into the project's own vendor/ shares the project
autoloader and eager-loads every autoload.files entry, which fatals the instant one of
them uses syntax newer than the runtime — the very code being downgraded. The isolated
install avoids that, and the throwaway directory is removed when the step finishes.
Requires PHP and Composer on the runner (e.g. via shivammathur/setup-php).
| Input | Required | Default | Description |
|---|---|---|---|
paths |
yes | — | Space-separated files or directories to downgrade, workspace-relative. |
php-version |
no | 8.1 |
Target PHP version: one of 8.0, 8.1, 8.2, 8.3, 8.4. |
skip |
no | '' |
Space-separated paths or glob patterns to skip — e.g. unparseable resource stubs or fixtures. |
rector-version |
no | ^2.6 |
Composer version constraint for the throwaway rector/rector. |
- uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
- uses: ramsey/composer-install@v3
with:
composer-options: --ignore-platform-req=php
- name: Downgrade the sources to PHP 8.1
uses: php-testo/actions/downgrade-php@v1
with:
paths: core plugin bridge tests testo.php
php-version: '8.1'
skip: bridge/symfony-console/resources/stubs
- run: composer test