Skip to content

Commit 8e5edbf

Browse files
committed
GH Actions: use the xmllint-validate action runner
Instead of doing all the installation steps for xmllint validation in the workflow, use the ✨ new dedicated `phpcsstandards/xmllint-validate` action runner instead. Ref: https://github.com/marketplace/actions/xmllint-validate
1 parent 793494e commit 8e5edbf

File tree

1 file changed

+11
-22
lines changed

1 file changed

+11
-22
lines changed

.github/workflows/basics.yml

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,18 @@ jobs:
5252
# Bust the cache at least once a month - output format: YYYY-MM.
5353
custom-cache-suffix: $(date -u "+%Y-%m")
5454

55-
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
56-
# This should not be blocking for this job, so ignore any errors from this step.
57-
# Ref: https://github.com/dotnet/core/issues/4167
58-
- name: Update the available packages list
59-
continue-on-error: true
60-
run: sudo apt-get update
61-
62-
- name: Install xmllint
63-
run: sudo apt-get install --no-install-recommends -y libxml2-utils
64-
65-
# Show XML violations inline in the file diff.
66-
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
67-
- name: Enable showing XML issues inline
68-
uses: korelstar/xmllint-problem-matcher@v1
69-
70-
# Validate the Ruleset XML file.
71-
# @link http://xmlsoft.org/xmllint.html
72-
- name: Validate rulesets against schema
73-
run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml
55+
# Validate XML files against schema.
56+
- name: Validate XML rulesets against schema
57+
uses: phpcsstandards/xmllint-validate@v1
58+
with:
59+
pattern: "./*/ruleset.xml"
60+
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd"
7461

75-
# Validate the Documentation XML files.
76-
- name: Validate documentation against schema
77-
run: xmllint --noout --schema vendor/phpcsstandards/phpcsdevtools/DocsXsd/phpcsdocs.xsd ./*/Docs/*/*Standard.xml
62+
- name: Validate documentation XML against schema
63+
uses: phpcsstandards/xmllint-validate@v1
64+
with:
65+
pattern: "./*/Docs/*/*Standard.xml"
66+
xsd-file: "vendor/phpcsstandards/phpcsdevtools/DocsXsd/phpcsdocs.xsd"
7867

7968
# Check the code-style consistency of the PHP files.
8069
- name: Check PHP code style

0 commit comments

Comments
 (0)