Skip to content

Commit dc02d51

Browse files
[BUGFIX] Require a PHP-CS-Fixer version that supports the PER standard (#83)
* [BUGFIX] Require a PHP-CS-Fixer version that support the PER standard We recently switch from PSR-2 to PER as our base coding standard. As this standard got introduced in PHP-CS-Fixer 3.11.0, we need that have this version as the minimum required version. Fixes #82 * Extend CI Co-authored-by: Simon Gilli <[email protected]>
1 parent 73cde90 commit dc02d51

File tree

2 files changed

+53
-5
lines changed

2 files changed

+53
-5
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,39 @@ jobs:
133133
needs:
134134
- php_lint
135135
runs-on: ubuntu-latest
136+
continue-on-error: ${{ matrix.experimental }}
137+
138+
strategy:
139+
fail-fast: false
140+
matrix:
141+
php-version:
142+
- '8.0'
143+
- '8.1'
144+
dependencies:
145+
- 'lowest'
146+
- 'stable'
147+
- 'highest'
148+
experimental:
149+
- false
150+
include:
151+
- php-version: 'latest'
152+
dependencies: 'lowest'
153+
experimental: true
154+
- php-version: 'latest'
155+
dependencies: 'stable'
156+
experimental: true
157+
- php-version: 'latest'
158+
dependencies: 'highest'
159+
experimental: true
160+
- php-version: 'nightly'
161+
dependencies: 'lowest'
162+
experimental: true
163+
- php-version: 'nightly'
164+
dependencies: 'stable'
165+
experimental: true
166+
- php-version: 'nightly'
167+
dependencies: 'highest'
168+
experimental: true
136169

137170
steps:
138171
- name: Checkout
@@ -144,7 +177,7 @@ jobs:
144177
coverage: none
145178
extensions: intl, zip
146179
ini-values: memory_limit=-1, error_reporting=E_ALL, display_errors=On
147-
php-version: '8.1'
180+
php-version: ${{ matrix.php-version }}
148181

149182
- name: Composer Cache Vars
150183
id: composer-cache-vars
@@ -156,16 +189,31 @@ jobs:
156189
uses: actions/cache@v3
157190
with:
158191
path: ${{ steps.composer-cache-vars.outputs.dir }}
159-
key: ${{ runner.os }}-composer-2-latest-${{ steps.composer-cache-vars.outputs.timestamp }}
192+
key: ${{ runner.os }}-composer-2-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ steps.composer-cache-vars.outputs.timestamp }}
160193
restore-keys: |
161-
${{ runner.os }}-composer-2-latest-
194+
${{ runner.os }}-composer-2-${{ matrix.php-version }}-${{ matrix.dependencies }}-
195+
${{ runner.os }}-composer-2-${{ matrix.php-version }}-
162196
${{ runner.os }}-composer-2-
163197
${{ runner.os }}-composer-
164198
199+
- name: Handle lowest dependencies update
200+
if: contains(matrix.dependencies, 'lowest')
201+
run: echo "COMPOSER_UPDATE_FLAGS=$COMPOSER_UPDATE_FLAGS --prefer-lowest" >> $GITHUB_ENV
202+
203+
- name: Allow alpha releases for latest-deps builds to catch problems earlier
204+
if: contains(matrix.dependencies, 'highest')
205+
run: composer config minimum-stability alpha
206+
207+
- name: Set platform.php for nightly
208+
if: ${{ matrix.php-version == 'nightly' }}
209+
run: |
210+
composer config platform.php 8.1.99
211+
165212
- name: Install dependencies
166-
run: composer install ${{ env.COMPOSER_INSTALL_FLAGS }} ${{ env.COMPOSER_FLAGS }}
213+
run: composer update ${{ env.COMPOSER_UPDATE_FLAGS }} ${{ env.COMPOSER_INSTALL_FLAGS }} ${{ env.COMPOSER_FLAGS }}
167214

168215
- name: Validation of coding standards for PHP files
216+
continue-on-error: ${{ matrix.experimental }}
169217
run: composer ci:php:cs
170218

171219
php_stan:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"require": {
3232
"php": "^8.0",
3333
"ext-json": "*",
34-
"friendsofphp/php-cs-fixer": "^3.0",
34+
"friendsofphp/php-cs-fixer": "^3.11",
3535
"symfony/console": "^4.4.30 || ^5.3.7 || ^6.0",
3636
"symfony/filesystem": "^4.4 || ^5.0 || ^6.0"
3737
},

0 commit comments

Comments
 (0)