Skip to content

Commit 388df2d

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 0985807 commit 388df2d

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

.github/workflows/qa.yml

+8-20
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,14 @@ jobs:
4747
# Bust the cache at least once a month - output format: YYYY-MM.
4848
custom-cache-suffix: $(date -u "+%Y-%m")
4949

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

70-
# Check the code-style consistency of the XML ruleset files.
57+
# Check the code-style consistency of the XML ruleset file.
58+
# Note: this needs xmllint, but that will be installed via the phpcsstandards/xmllint-validate action runner in the previous step.
7159
- name: Check XML ruleset code style
7260
run: diff -B --tabsize=4 ./PHPParallelLint/ruleset.xml <(xmllint --format "./PHPParallelLint/ruleset.xml")

0 commit comments

Comments
 (0)