From b7bf97d5b434b46b9e8e79761da95c46e4e57061 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Fri, 18 Apr 2025 19:04:20 +0100 Subject: [PATCH] CI: Fix PHPCS paths and PHP 8.0 dependency handling --- .github/workflows/tests.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a832aa..3fd6c7d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,8 +29,13 @@ jobs: - name: Install dependencies run: | if [[ "${{ matrix.php-versions }}" == "7.0" ]]; then + # Force PHPUnit 6.5 for PHP 7.0 composer require --dev phpunit/phpunit:"^6.5" --update-with-dependencies + elif [[ "${{ matrix.php-versions }}" == "8.0" ]]; then + # Update PHPUnit and WP_Mock for PHP 8.0 + composer require --dev phpunit/phpunit:"^9.5" 10up/wp_mock:"^1.0" --no-update fi + # Update all dependencies based on composer.json/composer.lock and any modifications above composer update --prefer-dist --no-progress - name: Run tests @@ -55,4 +60,4 @@ jobs: run: composer update --prefer-dist --no-progress - name: Run PHPCS - run: ./vendor/bin/phpcs --standard=WordPress --runtime-set installed_paths vendor/wp-coding-standards/wpcs ./includes ./admin ./wp-plugin-starter-template.php + run: ./vendor/bin/phpcs --standard=WordPress ./includes ./admin ./wp-plugin-starter-template.php