Skip to content

Commit 771cb52

Browse files
committed
GH Actions: add some additional XML validation checks
... for dev tool files.
1 parent ec3cc04 commit 771cb52

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/basics.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,30 @@ jobs:
6767
diff -B --tabsize=4 ./WordPressVIPMinimum/ruleset.xml <(xmllint --format "./WordPressVIPMinimum/ruleset.xml")
6868
diff -B --tabsize=4 ./WordPress-VIP-Go/ruleset.xml <(xmllint --format "./WordPress-VIP-Go/ruleset.xml")
6969
70+
# Validate dev tool related XML files.
71+
- name: Validate Project PHPCS ruleset against schema
72+
uses: phpcsstandards/xmllint-validate@v1
73+
with:
74+
pattern: ".phpcs.xml.dist"
75+
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd"
76+
77+
# Notes:
78+
# - PHPUnit 9.5 (which will be installed in this job) doesn't ship XSD files further back than 8.5.
79+
# - PHPUnit 9.3 introduced some new configuration options and deprecated the old versions of those.
80+
# For cross-version compatibility with older PHPUnit versions, those new config options cannot be used yet,
81+
# which is why the PHPUnit 9 validation is done against the PHPUnit 9.2 schema.
82+
- name: "Validate PHPUnit config for use with PHPUnit 8"
83+
uses: phpcsstandards/xmllint-validate@v1
84+
with:
85+
pattern: "phpunit.xml.dist"
86+
xsd-file: "vendor/phpunit/phpunit/schema/8.5.xsd"
87+
88+
- name: "Validate PHPUnit config for use with PHPUnit 9"
89+
uses: phpcsstandards/xmllint-validate@v1
90+
with:
91+
pattern: "phpunit.xml.dist"
92+
xsd-file: "vendor/phpunit/phpunit/schema/9.2.xsd"
93+
7094
# Check the code-style consistency of the PHP files.
7195
- name: Check PHP code style
7296
id: phpcs

0 commit comments

Comments
 (0)