2424 # Don't run the cronjob in this workflow on forks.
2525 if : github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
2626
27- env :
28- XMLLINT_INDENT : ' '
29-
3027 steps :
3128 - name : Checkout code
3229 uses : actions/checkout@v4
5956 - name : Validate XSD against schema
6057 run : xmllint --noout --schema ./XMLSchema.xsd ./phpcs.xsd
6158
59+ # Validate the basic well-formedness of the Documentation XML files.
60+ - name : Validate documentation XML
61+ run : xmllint --noout ./src/Standards/*/Docs/*/*Standard.xml
62+
63+ xml-cs :
64+ name : ' XML Code style'
65+ runs-on : ubuntu-latest
66+
67+ # Don't run the cronjob in this workflow on forks.
68+ if : github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'PHPCSStandards')
69+
70+ env :
71+ XMLLINT_INDENT : ' '
72+
73+ steps :
74+ - name : Checkout code
75+ uses : actions/checkout@v4
76+
77+ # Updating the lists can fail intermittently, typically after Microsoft has released a new package.
78+ # This should not be blocking for this job, so ignore any errors from this step.
79+ # Ref: https://github.com/dotnet/core/issues/4167
80+ - name : Update the available packages list
81+ continue-on-error : true
82+ run : sudo apt-get update
83+
84+ - name : Install xmllint
85+ run : sudo apt-get install --no-install-recommends -y libxml2-utils
86+
87+ # Show XML violations inline in the file diff.
88+ - name : Enable showing XML issues inline
89+ uses : korelstar/xmllint-problem-matcher@v1
90+
6291 # Check the code-style consistency of the XML files.
6392 - name : Check XML code style
6493 run : |
@@ -71,10 +100,6 @@ jobs:
71100 diff -B ./src/Standards/Squiz/ruleset.xml <(xmllint --format "./src/Standards/Squiz/ruleset.xml")
72101 diff -B ./src/Standards/Zend/ruleset.xml <(xmllint --format "./src/Standards/Zend/ruleset.xml")
73102
74- # Validate the basic well-formedness of the Documentation XML files.
75- - name : Validate documentation XML
76- run : xmllint --noout ./src/Standards/*/Docs/*/*Standard.xml
77-
78103 yamllint :
79104 name : ' Lint Yaml'
80105 # Don't run the cronjob in this workflow on forks.
0 commit comments