@@ -18,30 +18,40 @@ concurrency:
1818jobs :
1919 # Run CI checks/tests which have no dependency on the PHPCS version used.
2020 test-php :
21- runs-on : ubuntu-latest
21+ runs-on : ${{ matrix.os }}
2222
2323 strategy :
2424 matrix :
25+ os : ['ubuntu-latest', 'windows-latest']
2526 php : ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
2627
27- name : " Test + Lint: PHP ${{ matrix.php }}"
28+ name : " Test + Lint: PHP ${{ matrix.php }} - OS ${{ matrix.os }} "
2829
2930 continue-on-error : ${{ matrix.php == '8.5' }}
3031
3132 steps :
33+ - name : Prepare git to leave line endings alone
34+ run : git config --global core.autocrlf input
35+
3236 - name : Checkout code
3337 uses : actions/checkout@v4
3438
3539 # Updating the lists can fail intermittently, typically after Microsoft has released a new package.
3640 # This should not be blocking for this job, so ignore any errors from this step.
3741 # Ref: https://github.com/dotnet/core/issues/4167
38- - name : Update the available packages list
42+ - name : Update the available packages list (Linux)
43+ if : runner.os == 'Linux'
3944 continue-on-error : true
4045 run : sudo apt-get update
4146
42- - name : Install xmllint
47+ - name : Install xmllint (Linux)
48+ if : runner.os == 'Linux'
4349 run : sudo apt-get install --no-install-recommends -y libxml2-utils
4450
51+ - name : Install xmllint (Windows)
52+ if : runner.os == 'Windows'
53+ run : choco install xsltproc
54+
4555 - name : Install PHP
4656 uses : shivammathur/setup-php@v2
4757 with :
@@ -75,12 +85,14 @@ jobs:
7585
7686 - name : Grab PHPUnit version
7787 id : phpunit_version
88+ shell : bash
7889 # yamllint disable rule:line-length
7990 run : echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
8091 # yamllint enable rule:line-length
8192
8293 - name : Determine PHPUnit composer script to use
8394 id : phpunit_script
95+ shell : bash
8496 run : |
8597 if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
8698 echo 'SUFFIX=' >> "$GITHUB_OUTPUT"
95107
96108 # Run CI checks/tests which have a dependency on the PHPCS version used.
97109 test-phpcs :
98- runs-on : ubuntu-latest
110+ runs-on : ${{ matrix.os }}
99111
100112 strategy :
101113 # Keys:
@@ -110,63 +122,132 @@ jobs:
110122 # - PHP 8.2 needs PHPCS 3.6.1+ to run without errors.
111123 # - PHP 8.3 needs PHPCS 3.8.0+ to run without errors (though the errors don't affect this package).
112124 # - PHP 8.4 needs PHPCS 3.8.0+ to run without errors (officially 3.11.0, but 3.8.0 will work fine).
125+ os : ['ubuntu-latest', 'windows-latest']
113126 php : ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2']
114127 phpcs_version : ['3.1.0', 'dev-master']
115128
116129 include :
117130 # Complete the matrix, while preventing issues with PHPCS versions incompatible with certain PHP versions.
118- - php : ' 7.3'
131+ - os : ubuntu-latest
132+ php : ' 7.3'
119133 phpcs_version : ' dev-master'
120- - php : ' 7.3'
134+ - os : ubuntu-latest
135+ php : ' 7.3'
136+ phpcs_version : ' 3.3.1'
137+ - os : windows-latest
138+ php : ' 7.3'
139+ phpcs_version : ' dev-master'
140+ - os : windows-latest
141+ php : ' 7.3'
121142 phpcs_version : ' 3.3.1'
122143
123- - php : ' 7.4'
144+ - os : ubuntu-latest
145+ php : ' 7.4'
146+ phpcs_version : ' dev-master'
147+ - os : ubuntu-latest
148+ php : ' 7.4'
149+ phpcs_version : ' 3.5.0'
150+ - os : windows-latest
151+ php : ' 7.4'
124152 phpcs_version : ' dev-master'
125- - php : ' 7.4'
153+ - os : windows-latest
154+ php : ' 7.4'
126155 phpcs_version : ' 3.5.0'
127156
128- - php : ' 8.0'
157+ - os : ubuntu-latest
158+ php : ' 8.0'
159+ phpcs_version : ' dev-master'
160+ - os : ubuntu-latest
161+ php : ' 8.0'
162+ phpcs_version : ' 3.5.7'
163+ - os : windows-latest
164+ php : ' 8.0'
129165 phpcs_version : ' dev-master'
130- - php : ' 8.0'
166+ - os : windows-latest
167+ php : ' 8.0'
131168 phpcs_version : ' 3.5.7'
132169
133- - php : ' 8.1'
170+ - os : ubuntu-latest
171+ php : ' 8.1'
172+ phpcs_version : ' dev-master'
173+ - os : ubuntu-latest
174+ php : ' 8.1'
175+ phpcs_version : ' 3.6.1'
176+ - os : windows-latest
177+ php : ' 8.1'
134178 phpcs_version : ' dev-master'
135- - php : ' 8.1'
179+ - os : windows-latest
180+ php : ' 8.1'
136181 phpcs_version : ' 3.6.1'
137182
138- - php : ' 8.2'
183+ - os : ubuntu-latest
184+ php : ' 8.2'
139185 phpcs_version : ' dev-master'
140- - php : ' 8.2'
186+ - os : ubuntu-latest
187+ php : ' 8.2'
188+ phpcs_version : ' 3.6.1'
189+ - os : windows-latest
190+ php : ' 8.2'
191+ phpcs_version : ' dev-master'
192+ - os : windows-latest
193+ php : ' 8.2'
141194 phpcs_version : ' 3.6.1'
142195
143- - php : ' 8.3'
196+ - os : ubuntu-latest
197+ php : ' 8.3'
144198 phpcs_version : ' dev-master'
145- - php : ' 8.3'
199+ - os : ubuntu-latest
200+ php : ' 8.3'
201+ phpcs_version : ' 3.8.0'
202+ - os : windows-latest
203+ php : ' 8.3'
204+ phpcs_version : ' dev-master'
205+ - os : windows-latest
206+ php : ' 8.3'
146207 phpcs_version : ' 3.8.0'
147208
148- - php : ' 8.4'
209+ - os : ubuntu-latest
210+ php : ' 8.4'
149211 phpcs_version : ' dev-master'
150- - php : ' 8.4'
212+ - os : ubuntu-latest
213+ php : ' 8.4'
214+ phpcs_version : ' 3.8.0'
215+ - os : windows-latest
216+ php : ' 8.4'
217+ phpcs_version : ' dev-master'
218+ - os : windows-latest
219+ php : ' 8.4'
151220 phpcs_version : ' 3.8.0'
152221
153222 # Experimental builds. These are allowed to fail.
154- - php : ' 7.4'
223+ - os : ubuntu-latest
224+ php : ' 7.4'
225+ phpcs_version : ' 4.0.x-dev'
226+ - os : windows-latest
227+ php : ' 7.4'
155228 phpcs_version : ' 4.0.x-dev'
156229
157- - php : ' 8.5' # Nightly.
230+ - os : ubuntu-latest
231+ php : ' 8.5' # Nightly.
232+ phpcs_version : ' dev-master'
233+ - os : windows-latest
234+ php : ' 8.5' # Nightly.
158235 phpcs_version : ' dev-master'
159236
160- name : " Test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }}"
237+ name : " Test: PHP ${{ matrix.php }} - PHPCS ${{ matrix.phpcs_version }} - OS ${{ matrix.os }} "
161238
162239 continue-on-error : ${{ matrix.php == '8.5' || matrix.phpcs_version == '4.0.x-dev' }}
163240
164241 steps :
242+ - name : Prepare git to leave line endings alone
243+ run : git config --global core.autocrlf input
244+
165245 - name : Checkout code
166246 uses : actions/checkout@v4
167247
168248 - name : Setup ini config
169249 id : set_ini
250+ shell : bash
170251 run : |
171252 # On stable PHPCS versions, allow for PHP deprecation notices.
172253 # Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
@@ -201,12 +282,14 @@ jobs:
201282
202283 - name : Grab PHPUnit version
203284 id : phpunit_version
285+ shell : bash
204286 # yamllint disable rule:line-length
205287 run : echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> "$GITHUB_OUTPUT"
206288 # yamllint enable rule:line-length
207289
208290 - name : Determine PHPUnit composer script to use
209291 id : phpunit_script
292+ shell : bash
210293 run : |
211294 if [ "${{ startsWith( steps.phpunit_version.outputs.VERSION, '11.' ) }}" == "true" ]; then
212295 echo 'SUFFIX=' >> "$GITHUB_OUTPUT"
0 commit comments