35
35
required : false
36
36
type : ' boolean'
37
37
default : false
38
+ html5lib-tests :
39
+ description : ' Whether to run the html5lib tests'
40
+ required : false
41
+ type : ' boolean'
42
+ default : false
38
43
phpunit-config :
39
44
description : ' The PHPUnit configuration file to use'
40
45
required : false
80
85
# - Checks out the WordPress Test reporter repository.
81
86
# - Submit the test results to the WordPress.org host test results.
82
87
phpunit-tests :
83
- name : PHP ${{ inputs.php }} / ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.multisite && ' multisite' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}
88
+ name : PHP ${{ inputs.php }} / ${{ 'mariadb' == inputs.db-type && 'MariaDB' || 'MySQL' }} ${{ inputs.db-version }}${{ inputs.html5lib-tests && ' (html5lib tests only)' || '' }}${{ inputs. multisite && ' multisite' || '' }}${{ inputs.memcached && ' with memcached' || '' }}${{ inputs.report && ' (test reporting enabled)' || '' }} ${{ 'example.org' != inputs.tests-domain && inputs.tests-domain || '' }}
84
89
runs-on : ${{ inputs.os }}
85
90
timeout-minutes : 20
86
91
@@ -156,19 +161,37 @@ jobs:
156
161
run : npm run env:install
157
162
158
163
- name : Run PHPUnit tests
164
+ if : ${{ ! inputs.html5lib-tests }}
159
165
run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}
160
166
161
167
- name : Run AJAX tests
168
+ if : ${{ ! inputs.html5lib-tests }}
162
169
run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
163
170
164
171
- name : Run ms-files tests as a multisite install
165
- if : ${{ inputs.multisite }}
172
+ if : ${{ inputs.multisite && ! inputs.html5lib-tests }}
166
173
run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ms-files
167
174
168
175
- name : Run external HTTP tests
169
- if : ${{ ! inputs.multisite }}
176
+ if : ${{ ! inputs.multisite && ! inputs.html5lib-tests }}
170
177
run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group external-http
171
178
179
+ - name : Check if the HTML API was modified
180
+ id : check-for-html-api-changes
181
+ if : ${{ inputs.html5lib-tests }}
182
+ uses : tj-actions/changed-files@v44
183
+ with :
184
+ files : |
185
+ src/wp-includes/html-api/**.php
186
+ tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
187
+ tests/phpunit/data/html5lib-tests/**.dat
188
+ .github/workflows/phpunit-tests.yml
189
+ .github/workflows/reusable-phpunit-tests.yml
190
+
191
+ - name : Run html5lib tests
192
+ if : ${{ inputs.html5lib-tests && steps.check-for-html-api-changes.outputs.any_changed == 'true' }}
193
+ run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group html-api-html5lib-tests
194
+
172
195
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
173
196
- name : Run (Xdebug) tests
174
197
if : ${{ inputs.php != '8.3' }}
@@ -178,15 +201,15 @@ jobs:
178
201
run : git diff --exit-code
179
202
180
203
- name : Checkout the WordPress Test Reporter
181
- if : ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report }}
204
+ if : ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report && ! inputs.html5lib-tests }}
182
205
uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
183
206
with :
184
207
repository : ' WordPress/phpunit-test-runner'
185
208
path : ' test-runner'
186
209
show-progress : ${{ runner.debug == '1' && 'true' || 'false' }}
187
210
188
211
- name : Submit test results to the WordPress.org host test results
189
- if : ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report }}
212
+ if : ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report && ! inputs.html5lib-tests }}
190
213
env :
191
214
WPT_REPORT_API_KEY : " ${{ secrets.WPT_REPORT_API_KEY }}"
192
215
run : docker compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php
0 commit comments