Skip to content

Commit 110dca5

Browse files
committed
GH Actions: split XML code style check off from "Basic QA"check
The intention is for there to be a dedicated action runner available at some point for XML code style checking, so let's move this to a separate job. Also see: #145
1 parent 2612faa commit 110dca5

File tree

1 file changed

+32
-10
lines changed

1 file changed

+32
-10
lines changed

.github/workflows/cs.yml

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ jobs:
1919
name: 'Basic CS and QA checks'
2020
runs-on: ubuntu-latest
2121

22-
env:
23-
XMLLINT_INDENT: ' '
24-
2522
steps:
2623
- name: Checkout code
2724
uses: actions/checkout@v4
@@ -82,13 +79,6 @@ jobs:
8279
- name: Validate docs against schema
8380
run: xmllint --noout --schema DocsXsd/phpcsdocs.xsd ./PHPCSDebug/Docs/*/*Standard.xml
8481

85-
# Check code-style consistency of the XSD and XML files.
86-
- name: Check XSD code style
87-
run: diff -B ./DocsXsd/phpcsdocs.xsd <(xmllint --format "./DocsXsd/phpcsdocs.xsd")
88-
89-
- name: Check Ruleset XML code style
90-
run: diff -B ./PHPCSDebug/ruleset.xml <(xmllint --format "./PHPCSDebug/ruleset.xml")
91-
9282
# Check the code-style consistency of the PHP files.
9383
- name: Check PHP code style
9484
id: phpcs
@@ -98,5 +88,37 @@ jobs:
9888
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
9989
run: cs2pr ./phpcs-report.xml
10090

91+
xml-cs:
92+
name: 'XML Code style'
93+
runs-on: ubuntu-latest
94+
95+
env:
96+
XMLLINT_INDENT: ' '
97+
98+
steps:
99+
- name: Checkout code
100+
uses: actions/checkout@v4
101+
102+
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
103+
# This should not be blocking for this job, so ignore any errors from this step.
104+
# Ref: https://github.com/dotnet/core/issues/4167
105+
- name: Update the available packages list
106+
continue-on-error: true
107+
run: sudo apt-get update
108+
109+
- name: Install xmllint
110+
run: sudo apt-get install --no-install-recommends -y libxml2-utils
111+
112+
# Show XML violations inline in the file diff.
113+
- name: Enable showing XML issues inline
114+
uses: korelstar/xmllint-problem-matcher@v1
115+
116+
# Check code-style consistency of the XSD and XML files.
117+
- name: Check XSD code style
118+
run: diff -B ./DocsXsd/phpcsdocs.xsd <(xmllint --format "./DocsXsd/phpcsdocs.xsd")
119+
120+
- name: Check Ruleset XML code style
121+
run: diff -B ./PHPCSDebug/ruleset.xml <(xmllint --format "./PHPCSDebug/ruleset.xml")
122+
101123
phpstan:
102124
uses: PHPCSStandards/.github/.github/workflows/reusable-phpstan.yml@main

0 commit comments

Comments
 (0)