Skip to content

Commit 56fa5f5

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 5fa83bc commit 56fa5f5

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,19 @@ jobs:
3434
- name: Install dependencies
3535
run: composer install --prefer-dist --no-interaction --no-progress
3636

37-
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
38-
# This should not be blocking for this job, so ignore any errors from this step.
39-
# Ref: https://github.com/dotnet/core/issues/4167
40-
- name: Update the available packages list
41-
continue-on-error: true
42-
run: sudo apt-get update
43-
44-
- name: Install xmllint
45-
run: sudo apt-get install --no-install-recommends -y libxml2-utils
46-
47-
# Show violations inline in the file diff.
48-
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
49-
- name: Enable showing XML issues inline
50-
uses: korelstar/xmllint-problem-matcher@v1
51-
5237
# Validate the composer.json file.
5338
# @link https://getcomposer.org/doc/03-cli.md#validate
5439
- name: Validate Composer installation
5540
run: composer validate --no-check-all --strict
5641

5742
# Validate the xml file.
58-
# @link http://xmlsoft.org/xmllint.html
5943
- name: Validate against schema
60-
run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd PHPCSDev/ruleset.xml
44+
uses: phpcsstandards/xmllint-validate@v1
45+
with:
46+
pattern: "PHPCSDev/ruleset.xml"
47+
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd"
6148

6249
# Check the code-style consistency of the xml file.
50+
# Note: this needs xmllint, but that will be installed via the phpcsstandards/xmllint-validate action runner.
6351
- name: Check code style
6452
run: diff -B ./PHPCSDev/ruleset.xml <(xmllint --format "./PHPCSDev/ruleset.xml")

0 commit comments

Comments
 (0)