Skip to content

Commit 6866172

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 0c1ea1d commit 6866172

File tree

1 file changed

+13
-25
lines changed

1 file changed

+13
-25
lines changed

.github/workflows/validate.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,25 @@ jobs:
2828
- name: Checkout code
2929
uses: actions/checkout@v4
3030

31-
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
32-
# This should not be blocking for this job, so ignore any errors from this step.
33-
# Ref: https://github.com/dotnet/core/issues/4167
34-
- name: Update the available packages list
35-
continue-on-error: true
36-
run: sudo apt-get update
37-
38-
- name: Install xmllint
39-
run: sudo apt-get install --no-install-recommends -y libxml2-utils
40-
41-
- name: Retrieve XML Schema
42-
run: curl -O https://www.w3.org/2012/04/XMLSchema.xsd
43-
44-
# Show XML violations inline in the file diff.
45-
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
46-
- name: Enable showing XML issues inline
47-
uses: korelstar/xmllint-problem-matcher@v1
31+
# Validate the XSD file.
32+
- name: Validate XSD against schema
33+
uses: phpcsstandards/xmllint-validate@v1
34+
with:
35+
pattern: "phpcs.xsd"
36+
xsd-url: "https://www.w3.org/2012/04/XMLSchema.xsd"
4837

4938
# Validate the XML ruleset files.
50-
# @link http://xmlsoft.org/xmllint.html
5139
- name: Validate rulesets against schema
52-
run: xmllint --noout --schema phpcs.xsd ./src/Standards/*/ruleset.xml
53-
54-
# Validate the XSD file.
55-
# @link http://xmlsoft.org/xmllint.html
56-
- name: Validate XSD against schema
57-
run: xmllint --noout --schema ./XMLSchema.xsd ./phpcs.xsd
40+
uses: phpcsstandards/xmllint-validate@v1
41+
with:
42+
pattern: "./src/Standards/*/ruleset.xml"
43+
xsd-file: "phpcs.xsd"
5844

5945
# Validate the basic well-formedness of the Documentation XML files.
6046
- name: Validate documentation XML
61-
run: xmllint --noout ./src/Standards/*/Docs/*/*Standard.xml
47+
uses: phpcsstandards/xmllint-validate@v1
48+
with:
49+
pattern: "./src/Standards/*/Docs/*/*Standard.xml"
6250

6351
xml-cs:
6452
name: 'XML Code style'

0 commit comments

Comments
 (0)