Skip to content

Commit c982928

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 110dca5 commit c982928

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

.github/workflows/cs.yml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,24 @@ jobs:
5050
# Bust the cache at least once a month - output format: YYYY-MM.
5151
custom-cache-suffix: $(date -u "+%Y-%m")
5252

53-
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
54-
# This should not be blocking for this job, so ignore any errors from this step.
55-
# Ref: https://github.com/dotnet/core/issues/4167
56-
- name: Update the available packages list
57-
continue-on-error: true
58-
run: sudo apt-get update
59-
60-
# @link http://xmlsoft.org/xmllint.html
61-
- name: Install xmllint
62-
run: sudo apt-get install --no-install-recommends -y libxml2-utils
63-
64-
- name: Download the XSD schema
65-
run: curl http://www.w3.org/2001/XMLSchema.xsd --output XMLSchema.xsd
66-
67-
# Show XML violations inline in the file diff.
68-
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
69-
- name: Enable showing XML issues inline
70-
uses: korelstar/xmllint-problem-matcher@v1
71-
7253
# Validate the XSD and XML files against schema.
7354
- name: Validate Docs XSD against schema
74-
run: xmllint --noout --schema XMLSchema.xsd DocsXsd/phpcsdocs.xsd
55+
uses: phpcsstandards/xmllint-validate@v1
56+
with:
57+
pattern: "DocsXsd/phpcsdocs.xsd"
58+
xsd-url: "https://www.w3.org/2012/04/XMLSchema.xsd"
7559

7660
- name: Validate PHPCSDebug ruleset against schema
77-
run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd PHPCSDebug/ruleset.xml
61+
uses: phpcsstandards/xmllint-validate@v1
62+
with:
63+
pattern: "PHPCSDebug/ruleset.xml"
64+
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd"
7865

7966
- name: Validate docs against schema
80-
run: xmllint --noout --schema DocsXsd/phpcsdocs.xsd ./PHPCSDebug/Docs/*/*Standard.xml
67+
uses: phpcsstandards/xmllint-validate@v1
68+
with:
69+
pattern: "PHPCSDebug/Docs/*/*Standard.xml"
70+
xsd-file: "DocsXsd/phpcsdocs.xsd"
8171

8272
# Check the code-style consistency of the PHP files.
8373
- name: Check PHP code style

0 commit comments

Comments
 (0)