Skip to content

Commit 910c3d2

Browse files
committed
Add html5lib tests input and steps.
1 parent ab6e1dc commit 910c3d2

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/reusable-phpunit-tests.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ on:
3434
description: 'Whether to test with memcached enabled'
3535
required: false
3636
type: 'boolean'
37+
default:
38+
html5lib-tests:
39+
description: 'Whether to run the html5lib tests'
40+
required: false
41+
type: 'boolean'
3742
default: false
3843
phpunit-config:
3944
description: 'The PHPUnit configuration file to use'
@@ -169,6 +174,21 @@ jobs:
169174
if: ${{ ! inputs.multisite }}
170175
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group external-http
171176

177+
- name: Check if the HTML API was modified
178+
id: check-for-html-api-changes
179+
if: {{ inputs.html5lib-tests }}
180+
uses: tj-actions/changed-files@v44
181+
with:
182+
files: |
183+
src/wp-includes/html-api/**.php
184+
tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
185+
tests/phpunit/data/html5lib-tests/**.dat
186+
.github/workflows/html5lib-tests.yml
187+
188+
- name: Run html5lib tests
189+
if: {{ inputs.html5lib-tests && steps.check-for-html-api-changes.outputs.any_changed == 'true' }}
190+
run: node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit --verbose -c ${{ env.PHPUNIT_CONFIG }} --group html-api-html5lib-tests
191+
172192
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
173193
- name: Run (Xdebug) tests
174194
if: ${{ inputs.php != '8.3' }}

0 commit comments

Comments
 (0)