Fix remaining CI/CD issues

- Add yoast/phpunit-polyfills ^2.0 to composer.json for WordPress test suite compatibility
- Define WP_TESTS_PHPUNIT_POLYFILLS_PATH in bootstrap.php before loading WP test framework
- Update actions/cache to v4 (deprecated SHA references cause failures)
- Update actions/setup-java to v4
- Update codacy/codacy-analysis-cli-action to v4 tag (SHA ref not found)
- Update github/codeql-action/upload-sarif to v3
This commit is contained in:
2025-11-24 19:38:01 +00:00
parent 1590be3ba6
commit c17b6f1818
3 changed files with 10 additions and 4 deletions

View File

@@ -10,6 +10,11 @@ require_once dirname( dirname( __DIR__ ) ) . '/vendor/autoload.php';
// Check if we're running the WordPress tests
if ( getenv( 'WP_PHPUNIT__DIR' ) ) {
// Define PHPUnit Polyfills path for WordPress test suite.
if ( ! defined( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH' ) ) {
define( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH', dirname( dirname( __DIR__ ) ) . '/vendor/yoast/phpunit-polyfills/' );
}
// Give access to tests_add_filter() function.
require_once getenv( 'WP_PHPUNIT__DIR' ) . '/includes/functions.php';