Build/Test Tools: Switch to always running the tests via Composer.
Previously the tests were run via a PHPUnit Phar file for PHP 5.6–7.4, with PHP 8.0 using a Composer-installed version of PHPUnit. Running the tests via a Phar without the need for a `composer install` is (marginally) faster in overall build time, however, this commit is part of a larger chain of changes which will make the test suite PHPUnit cross-version compatible. With an eye on those upcoming changes, which will allow us to run the tests on the most appropriate PHPUnit version for each supported PHP version, it is opportune to switch to using a Composer-installed version of PHPUnit for all PHP versions supported by WordPress. Previously this was not possible without additional conditional `update` commands being run, due to the `composer.lock` file being in place and being locked at PHPUnit 7.5.20. Switching over to using the Composer-installed PHPUnit version, with that PHPUnit version adjusting based on the PHP version, allows for some minor simplifications in the GitHub Actions script. This means we need additional measures to make sure that the Composer cache file does not go too far out of date as that would significantly slow down the builds. By adding a "Last Monday" date to the cache key, in combination with the pre-existing OS, PHP version and the hash of the `composer.json` file, we can guarantee that: 1. There will be a cache created for each OS/PHP combination. 2. These caches will be replaced whenever a change is made to the `composer.json` file. 3. These caches will be replaced every Monday of each week ensuring that the cache file does not go too far out of date. Note: The NPM script `test:php` is now no longer needed during the builds. However, to prevent breaking the workflow of contributors who may be used to having the command available, the command remains available. In a future iteration we may be able to replace the caching of the Composer dependencies with the Composer cache action as offered on the GitHub marketplace, which would further simplify the script. Follow-up to [42960], [46290], [47881], [48957], [49037], [51543], [51544]. Props jrf, desrosj. Fixes #47381. Built from https://develop.svn.wordpress.org/trunk@51545 git-svn-id: http://core.svn.wordpress.org/trunk@51156 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3db37d3459
commit
318fc1fcc9
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-51544';
|
||||
$wp_version = '5.9-alpha-51545';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue