Skip to content

Commit 7e7690e

Browse files
committed
Merge branch 'stable' into develop
2 parents 8209a98 + da21572 commit 7e7690e

File tree

1 file changed

+69
-27
lines changed

1 file changed

+69
-27
lines changed

.github/workflows/cs.yml

Lines changed: 69 additions & 27 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
@@ -53,50 +50,95 @@ jobs:
5350
# Bust the cache at least once a month - output format: YYYY-MM.
5451
custom-cache-suffix: $(date -u "+%Y-%m")
5552

53+
# Validate the XSD and XML files against schema.
54+
- name: Validate Docs XSD against schema
55+
uses: phpcsstandards/xmllint-validate@v1
56+
with:
57+
pattern: "DocsXsd/phpcsdocs.xsd"
58+
xsd-url: "https://www.w3.org/2012/04/XMLSchema.xsd"
59+
60+
- name: Validate PHPCSDebug ruleset against schema
61+
uses: phpcsstandards/xmllint-validate@v1
62+
with:
63+
pattern: "PHPCSDebug/ruleset.xml"
64+
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd"
65+
66+
- name: Validate docs against schema
67+
uses: phpcsstandards/xmllint-validate@v1
68+
with:
69+
pattern: "PHPCSDebug/Docs/*/*Standard.xml"
70+
xsd-file: "DocsXsd/phpcsdocs.xsd"
71+
72+
- name: Validate Project PHPCS ruleset against schema
73+
uses: phpcsstandards/xmllint-validate@v1
74+
with:
75+
pattern: "phpcs.xml.dist"
76+
xsd-file: "vendor/squizlabs/php_codesniffer/phpcs.xsd"
77+
78+
- name: "Validate PHPUnit < 10 config for use with PHPUnit 8"
79+
uses: phpcsstandards/xmllint-validate@v1
80+
with:
81+
pattern: "phpunitlte9.xml.dist"
82+
xsd-file: "vendor/phpunit/phpunit/schema/8.5.xsd"
83+
84+
- name: "Validate PHPUnit < 10 config for use with PHPUnit 9"
85+
uses: phpcsstandards/xmllint-validate@v1
86+
with:
87+
pattern: "phpunitlte9.xml.dist"
88+
xsd-file: "vendor/phpunit/phpunit/schema/9.5.xsd"
89+
90+
- name: "Validate PHPUnit 10+ config for use with PHPUnit 10"
91+
uses: phpcsstandards/xmllint-validate@v1
92+
with:
93+
pattern: "phpunit.xml.dist"
94+
xsd-file: "vendor/phpunit/phpunit/schema/10.5.xsd"
95+
96+
- name: "Validate PHPUnit 10+ config for use with PHPUnit 11"
97+
uses: phpcsstandards/xmllint-validate@v1
98+
with:
99+
pattern: "phpunit.xml.dist"
100+
xsd-file: "vendor/phpunit/phpunit/phpunit.xsd"
101+
102+
# Check the code-style consistency of the PHP files.
103+
- name: Check PHP code style
104+
id: phpcs
105+
run: composer checkcs -- --report-full --report-checkstyle=./phpcs-report.xml
106+
107+
- name: Show PHPCS results in PR
108+
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
109+
run: cs2pr ./phpcs-report.xml
110+
111+
xml-cs:
112+
name: 'XML Code style'
113+
runs-on: ubuntu-latest
114+
115+
env:
116+
XMLLINT_INDENT: ' '
117+
118+
steps:
119+
- name: Checkout code
120+
uses: actions/checkout@v4
121+
56122
# Updating the lists can fail intermittently, typically after Microsoft has released a new package.
57123
# This should not be blocking for this job, so ignore any errors from this step.
58124
# Ref: https://github.com/dotnet/core/issues/4167
59125
- name: Update the available packages list
60126
continue-on-error: true
61127
run: sudo apt-get update
62128

63-
# @link http://xmlsoft.org/xmllint.html
64129
- name: Install xmllint
65130
run: sudo apt-get install --no-install-recommends -y libxml2-utils
66131

67-
- name: Download the XSD schema
68-
run: curl http://www.w3.org/2001/XMLSchema.xsd --output XMLSchema.xsd
69-
70132
# Show XML violations inline in the file diff.
71-
# @link https://github.com/marketplace/actions/xmllint-problem-matcher
72133
- name: Enable showing XML issues inline
73134
uses: korelstar/xmllint-problem-matcher@v1
74135

75-
# Validate the XSD and XML files against schema.
76-
- name: Validate Docs XSD against schema
77-
run: xmllint --noout --schema XMLSchema.xsd DocsXsd/phpcsdocs.xsd
78-
79-
- name: Validate PHPCSDebug ruleset against schema
80-
run: xmllint --noout --schema vendor/squizlabs/php_codesniffer/phpcs.xsd PHPCSDebug/ruleset.xml
81-
82-
- name: Validate docs against schema
83-
run: xmllint --noout --schema DocsXsd/phpcsdocs.xsd ./PHPCSDebug/Docs/*/*Standard.xml
84-
85136
# Check code-style consistency of the XSD and XML files.
86137
- name: Check XSD code style
87138
run: diff -B ./DocsXsd/phpcsdocs.xsd <(xmllint --format "./DocsXsd/phpcsdocs.xsd")
88139

89140
- name: Check Ruleset XML code style
90141
run: diff -B ./PHPCSDebug/ruleset.xml <(xmllint --format "./PHPCSDebug/ruleset.xml")
91142

92-
# Check the code-style consistency of the PHP files.
93-
- name: Check PHP code style
94-
id: phpcs
95-
run: composer checkcs -- --report-full --report-checkstyle=./phpcs-report.xml
96-
97-
- name: Show PHPCS results in PR
98-
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
99-
run: cs2pr ./phpcs-report.xml
100-
101143
phpstan:
102144
uses: PHPCSStandards/.github/.github/workflows/reusable-phpstan.yml@main

0 commit comments

Comments
 (0)