Skip to content

Commit 4d17f39

Browse files
committed
Update for final PHPCS 4.0.0 release and main branch rename
* Change `dev-master` to `3.x-dev`. * Add explicit runs against the highest supported PHPCS 3.x version - currently `3.13.1`. * Add explicit runs against the lowest supported PHPCS 4.x version - currently `4.0.0`. * Remove 'dev' runs from `quicktest` and `coverage` jobs: these are no longer needed as 'stable' will now be `4.x`, so both 3.x as well as 4.x will be tested using just `lowest` and `stable`.
1 parent e51a630 commit 4d17f39

3 files changed

Lines changed: 45 additions & 61 deletions

File tree

.github/workflows/basics.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: 'Composer: adjust dependencies'
4444
run: >
4545
composer require --no-update --no-scripts --no-interaction
46-
squizlabs/php_codesniffer:"dev-master"
46+
squizlabs/php_codesniffer:"3.x-dev"
4747
phpcsstandards/phpcsutils:"dev-develop"
4848
4949
# Install dependencies and handle caching in one go.

.github/workflows/quicktest.yml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,55 +28,38 @@ jobs:
2828

2929
strategy:
3030
matrix:
31+
# Note, since the release of PHPCS 4.0, 'stable' == latest 4.x.
3132
php: ['5.4', 'latest']
32-
dependencies: ['lowest', 'stable', 'dev']
33+
dependencies: ['lowest', 'stable']
3334

3435
exclude:
3536
- php: '5.4'
36-
dependencies: 'dev'
37+
dependencies: 'stable'
3738

3839
include:
39-
# Replace the "low PHP" dev build for PHPCS 4.x.
40+
# Replace the "low PHP" stable build for PHPCS 4.x.
4041
- php: '7.2'
41-
dependencies: 'dev'
42+
dependencies: 'stable'
4243

4344
name: "QTest${{ matrix.dependencies == 'stable' && ' + Lint' || '' }}: PHP ${{ matrix.php }} - PHPCS ${{ matrix.dependencies }}"
4445

4546
steps:
4647
- name: Checkout code
4748
uses: actions/checkout@v5
4849

49-
# On stable PHPCS versions, allow for PHP deprecation notices.
50-
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
51-
- name: Setup ini config
52-
id: set_ini
53-
# yamllint disable rule:line-length
54-
run: |
55-
if [ "${{ matrix.dependencies == 'dev' }}" == "false" ]; then
56-
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On, display_startup_errors=On' >> "$GITHUB_OUTPUT"
57-
else
58-
echo 'PHP_INI=error_reporting=-1, display_errors=On, display_startup_errors=On' >> "$GITHUB_OUTPUT"
59-
fi
60-
# yamllint enable rule:line-length
61-
6250
- name: Install PHP
6351
uses: shivammathur/setup-php@v2
6452
with:
6553
php-version: ${{ matrix.php }}
66-
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
54+
# With stable PHPCS dependencies, allow for PHP deprecation notices.
55+
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
56+
ini-values: error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On
6757
coverage: none
6858

6959
# Remove PHPCSDevCS as it would (for now) prevent the tests from being able to run against PHPCS 4.x.
7060
- name: 'Composer: remove PHPCSDevCS'
7161
run: composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-interaction
7262

73-
- name: "Composer: set PHPCS version for tests (dev)"
74-
if: ${{ matrix.dependencies == 'dev' }}
75-
run: >
76-
composer require --no-scripts --no-interaction
77-
squizlabs/php_codesniffer:"4.x-dev"
78-
phpcsstandards/phpcsutils:"dev-develop"
79-
8063
- name: "Composer: use lock file when necessary"
8164
if: ${{ matrix.dependencies == 'lowest' }}
8265
run: composer config --unset lock

.github/workflows/test.yml

Lines changed: 36 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -68,42 +68,60 @@ jobs:
6868
#
6969
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
7070
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.5']
71-
phpcs_version: ['lowest', 'stable', '4.x-dev']
71+
phpcs_version: ['lowest', '^3.13', '4.0.0', 'stable']
7272
phpcsutils_version: ['stable']
7373

7474
exclude:
75+
# Note, since the release of PHPCS 4.0, 'stable' == latest 4.x.
7576
- php: '5.5'
76-
phpcs_version: '4.x-dev'
77+
phpcs_version: '4.0.0'
78+
- php: '5.5'
79+
phpcs_version: 'stable'
7780
- php: '5.6'
78-
phpcs_version: '4.x-dev'
81+
phpcs_version: '4.0.0'
82+
- php: '5.6'
83+
phpcs_version: 'stable'
7984
- php: '7.0'
80-
phpcs_version: '4.x-dev'
85+
phpcs_version: '4.0.0'
86+
- php: '7.0'
87+
phpcs_version: 'stable'
8188
- php: '7.1'
82-
phpcs_version: '4.x-dev'
89+
phpcs_version: '4.0.0'
90+
- php: '7.1'
91+
phpcs_version: 'stable'
92+
# Also exclude the 7.2/stable build as that's already run in code coverage, no need to duplicate.
93+
- php: '7.2'
94+
phpcs_version: 'stable'
8395

8496
include:
8597
# Add some builds with variations of the dependency versions.
8698
# Note: the PHPCS low/stable + Utils stable combi is already run via the above matrix.
8799
# And the PHPCS low + Utils low combi is run in the code coverage builds.
88100
# So these are the only combis missing.
89101
- php: '5.4'
102+
phpcs_version: '^3.13'
103+
phpcsutils_version: 'lowest'
104+
- php: '7.2'
90105
phpcs_version: 'stable'
91106
phpcsutils_version: 'lowest'
107+
- php: '8.4'
108+
phpcs_version: '^3.13'
109+
phpcsutils_version: 'lowest'
92110
- php: '8.4'
93111
phpcs_version: 'stable'
94112
phpcsutils_version: 'lowest'
95113

96114
# Test against dev versions of all dependencies with select PHP versions for early detection of issues.
97115
- php: '5.4'
98-
phpcs_version: 'dev-master'
116+
phpcs_version: '3.x-dev'
99117
phpcsutils_version: 'dev-develop'
100118
- php: '7.2'
101-
phpcs_version: 'dev-master'
102-
phpcsutils_version: 'dev-develop'
103-
- php: '7.4'
104119
phpcs_version: '4.x-dev'
105120
phpcsutils_version: 'dev-develop'
106-
- php: '8.2'
121+
- php: '8.4'
122+
phpcs_version: '3.x-dev'
123+
phpcsutils_version: 'dev-develop'
124+
- php: '8.4'
107125
phpcs_version: '4.x-dev'
108126
phpcsutils_version: 'dev-develop'
109127

@@ -199,55 +217,38 @@ jobs:
199217

200218
strategy:
201219
matrix:
220+
# Note, since the release of PHPCS 4.0, 'stable' == latest 4.x.
202221
php: ['5.4', '8.4']
203-
dependencies: ['lowest', 'stable', 'dev']
222+
dependencies: ['lowest', 'stable']
204223

205224
exclude:
206225
- php: '5.4'
207-
dependencies: 'dev'
226+
dependencies: 'stable'
208227

209228
include:
210-
# Replace the "low PHP" dev build for PHPCS 4.x.
229+
# Replace the "low PHP" stable build for PHPCS 4.x.
211230
- php: '7.2'
212-
dependencies: 'dev'
231+
dependencies: 'stable'
213232

214233
name: "Coverage: PHP ${{ matrix.php }} - PHPCS ${{ matrix.dependencies }}"
215234

216235
steps:
217236
- name: Checkout code
218237
uses: actions/checkout@v5
219238

220-
# On stable PHPCS versions, allow for PHP deprecation notices.
221-
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
222-
- name: Setup ini config
223-
id: set_ini
224-
# yamllint disable rule:line-length
225-
run: |
226-
if [ "${{ matrix.dependencies == 'dev' }}" == "false" ]; then
227-
echo 'PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On, display_startup_errors=On' >> "$GITHUB_OUTPUT"
228-
else
229-
echo 'PHP_INI=error_reporting=-1, display_errors=On, display_startup_errors=On' >> "$GITHUB_OUTPUT"
230-
fi
231-
# yamllint enable rule:line-length
232-
233239
- name: Install PHP
234240
uses: shivammathur/setup-php@v2
235241
with:
236242
php-version: ${{ matrix.php }}
237-
ini-values: ${{ steps.set_ini.outputs.PHP_INI }}
243+
# On stable PHPCS versions, allow for PHP deprecation notices.
244+
# Unit tests don't need to fail on those for stable releases where those issues won't get fixed anymore.
245+
ini-values: PHP_INI=error_reporting=E_ALL & ~E_DEPRECATED, display_errors=On
238246
coverage: xdebug
239247

240248
# Remove PHPCSDevCS as it would (for now) prevent the tests from being able to run against PHPCS 4.x.
241249
- name: 'Composer: remove PHPCSDevCS'
242250
run: composer remove --dev phpcsstandards/phpcsdevcs --no-update --no-interaction
243251

244-
- name: "Composer: set PHPCS version for tests (dev)"
245-
if: ${{ matrix.dependencies == 'dev' }}
246-
run: >
247-
composer require --no-scripts --no-interaction
248-
squizlabs/php_codesniffer:"4.x-dev"
249-
phpcsstandards/phpcsutils:"dev-develop"
250-
251252
- name: "Composer: use lock file when necessary"
252253
if: ${{ matrix.dependencies == 'lowest' }}
253254
run: composer config --unset lock

0 commit comments

Comments
 (0)