3535 required : false
3636 type : ' boolean'
3737 default : false
38+ html5lib-tests :
39+ description : ' Whether to run the html5lib tests'
40+ required : false
41+ type : ' boolean'
42+ default : false
3843 phpunit-config :
3944 description : ' The PHPUnit configuration file to use'
4045 required : false
8085 # - Checks out the WordPress Test reporter repository.
8186 # - Submit the test results to the WordPress.org host test results.
8287 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 || '' }}
8489 runs-on : ${{ inputs.os }}
8590 timeout-minutes : 20
8691
@@ -156,19 +161,36 @@ jobs:
156161 run : npm run env:install
157162
158163 - name : Run PHPUnit tests
164+ if : ${{ ! inputs.html5lib-tests }}
159165 run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }}
160166
161167 - name : Run AJAX tests
168+ if : ${{ ! inputs.html5lib-tests }}
162169 run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ajax
163170
164171 - name : Run ms-files tests as a multisite install
165- if : ${{ inputs.multisite }}
172+ if : ${{ inputs.multisite && ! inputs.html5lib-tests }}
166173 run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group ms-files
167174
168175 - name : Run external HTTP tests
169- if : ${{ ! inputs.multisite }}
176+ if : ${{ ! inputs.multisite && ! inputs.html5lib-tests }}
170177 run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group external-http
171178
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/html5lib-tests.yml
189+
190+ - name : Run html5lib tests
191+ if : ${{ inputs.html5lib-tests && steps.check-for-html-api-changes.outputs.any_changed == 'true' }}
192+ run : node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group html-api-html5lib-tests
193+
172194 # __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
173195 - name : Run (Xdebug) tests
174196 if : ${{ inputs.php != '8.3' }}
@@ -178,15 +200,15 @@ jobs:
178200 run : git diff --exit-code
179201
180202 - name : Checkout the WordPress Test Reporter
181- if : ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report }}
203+ if : ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report && ! inputs.html5lib-tests }}
182204 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
183205 with :
184206 repository : ' WordPress/phpunit-test-runner'
185207 path : ' test-runner'
186208 show-progress : ${{ runner.debug == '1' && 'true' || 'false' }}
187209
188210 - 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 }}
211+ if : ${{ github.repository == 'WordPress/wordpress-develop' && github.ref == 'refs/heads/trunk' && inputs.report && ! inputs.html5lib-tests }}
190212 env :
191213 WPT_REPORT_API_KEY : " ${{ secrets.WPT_REPORT_API_KEY }}"
192214 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