Skip to content

Commit eedf020

Browse files
committed
README: use the xmllint-validate action in the CI code sample
Ref: https://github.com/PHPCSStandards/xmllint-validate
1 parent da21572 commit eedf020

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

README.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,26 @@ jobs:
205205
steps:
206206
- uses: actions/checkout@v3
207207

208-
- name: Install xmllint
209-
run: |
210-
sudo apt-get update
211-
sudo apt-get install --no-install-recommends -y libxml2-utils
208+
- name: Validate docs against schema
209+
uses: phpcsstandards/xmllint-validate@v1
210+
with:
211+
pattern: "YourRuleset/Docs/**/*Standard.xml"
212+
xsd-url: "https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
213+
```
212214
213-
# A Composer install is needed to have a local copy of the XSD available.
214-
- run: composer install
215+
Or if you use this in a job which runs a `composer install`, you can reference the file in the vendor directory.
216+
```yaml
217+
jobs:
218+
validate-xml:
219+
runs-on: ubuntu-latest
220+
steps:
221+
- uses: actions/checkout@v3
215222
216223
- name: Validate docs against schema
217-
run: xmllint --noout --schema vendor/phpcsstandards/phpcsdevtools/DocsXsd/phpcsdocs.xsd ./YourRuleset/Docs/**/*Standard.xml
224+
uses: phpcsstandards/xmllint-validate@v1
225+
with:
226+
pattern: "YourRuleset/Docs/**/*Standard.xml"
227+
xsd-file: "vendor/phpcsstandards/phpcsdevtools/DocsXsd/phpcsdocs.xsd"
218228
```
219229

220230
:point_right: You'll need to replace the `YourRuleset` within the command with the name of your ruleset (of course).

0 commit comments

Comments
 (0)