@@ -115,83 +115,6 @@ jobs:
115115 echo "::error::WordPress Plugin Check failed. Created issue for tracking."
116116 exit 1
117117
118- unit-tests :
119- name : PHPUnit Tests (PHP ${{ matrix.php-version }})
120- runs-on : ubuntu-latest
121- strategy :
122- matrix :
123- php-version : ['7.4', '8.0', '8.1', '8.2', '8.3']
124- fail-fast : false
125-
126- services :
127- mysql :
128- image : mysql:8.4
129- env :
130- MYSQL_ROOT_PASSWORD : root
131- MYSQL_DATABASE : wordpress_test
132- ports :
133- - 3306:3306
134- options : --health-cmd="mysqladmin ping -proot --silent" --health-interval=10s --health-timeout=5s --health-retries=3
135-
136- steps :
137- - name : Checkout code
138- uses : actions/checkout@v6
139-
140- - name : Setup PHP ${{ matrix.php-version }}
141- uses : shivammathur/setup-php@v2
142- with :
143- php-version : ${{ matrix.php-version }}
144- extensions : mysqli, curl, zip, intl, gd, mbstring, fileinfo, xml
145- coverage : none
146- tools : composer:v2
147-
148- - name : Install Subversion
149- run : sudo apt-get update && sudo apt-get install -y subversion
150-
151- - name : Upgrade PHPUnit & polyfills for PHP 8.0–8.1
152- if : matrix.php-version == '8.0' || matrix.php-version == '8.1'
153- run : |
154- echo "🔧 Upgrading polyfills to v4.* for PHP 8.0-8.1..."
155- composer require --dev yoast/phpunit-polyfills:^4 --no-update
156-
157- - name : Upgrade PHPUnit & polyfills for PHP 8.2
158- if : matrix.php-version == '8.2'
159- run : |
160- echo "🔧 Upgrading to PHPUnit 11.* and polyfills 4.* for PHP 8.2..."
161- composer require --dev phpunit/phpunit:^11 --no-update
162- composer require --dev yoast/phpunit-polyfills:^4 --no-update
163-
164- - name : Upgrade PHPUnit & polyfills for PHP 8.3
165- if : matrix.php-version == '8.3'
166- run : |
167- echo "🔧 Upgrading to PHPUnit 12.* and polyfills 4.* for PHP 8.3..."
168- composer require --dev phpunit/phpunit:^12 --no-update
169- composer require --dev yoast/phpunit-polyfills:^4 --no-update
170-
171- - name : Install Composer dependencies
172- uses : ramsey/composer-install@v3
173- with :
174- dependency-versions : highest
175- composer-options : " --prefer-dist --no-progress"
176-
177- - name : Run PHPUnit Tests
178- run : |
179- echo "🧪 Running PHPUnit tests on PHP ${{ matrix.php-version }}..."
180- composer test
181- echo "✅ PHPUnit tests completed successfully!"
182-
183- - name : Create issue on test failure
184- if : ${{ failure() }}
185- uses : JasonEtco/create-an-issue@v2
186- env :
187- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
188- PHP_VERSION : ${{ matrix.php-version }}
189- RUN_ID : ${{ github.run_id }}
190- WORKFLOW_URL : ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
191- with :
192- filename : .github/ISSUE_TEMPLATE/phpunit-failure.md
193- update_existing : false
194-
195118 phpcs :
196119 name : PHPCS (PHP 8.3)
197120 runs-on : ubuntu-latest
@@ -664,7 +587,7 @@ jobs:
664587 runs-on : ubuntu-latest
665588 strategy :
666589 matrix :
667- php-version : ['7.4', '8.0', '8.3', '8.4', '8.5']
590+ php-version : ['7.4', '8.0', '8.1', '8.2', '8. 3', '8.4', '8.5']
668591 wp-version : ['6.6', 'latest', 'nightly']
669592 fail-fast : false
670593
0 commit comments