Skip to content

Commit

Permalink
feat: add compatibility support for Symfony 5.4, ^6.0
Browse files Browse the repository at this point in the history
* ignore composer.lock
* update test workflow and composer.json to test against various Symfony and PHP versions
* remove DockBlockLineLengthFixer rule as it's no longer present in version 11.4
  • Loading branch information
chiqui3d committed Dec 29, 2023
1 parent 587f052 commit a20e516
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 8,154 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Test

on:
workflow_dispatch:
push:
branches:
- master
Expand All @@ -18,14 +19,24 @@ concurrency:

jobs:
test:
name: Test

name: "Test PHP ${{ matrix.php }} with Symfony ${{ matrix.symfony_version }} and composer flags ${{ matrix.composer-flags }}"
runs-on: ubuntu-latest

strategy:
matrix:
php: ['8.0', '8.1', '8.2']

php: ['8.0', '8.1', '8.2', '8.3']
symfony_version: ['5.4.*', '6.0.*', '6.1.*', '6.2.*' , '6.3.*', '6.4.*']
composer-flags: ['--prefer-stable']
exclude:
- php: '8.0'
symfony_version: '5.4.*' # Exclusion due to issues with ECS
- php: '8.0'
symfony_version: '6.1.*' # Requires PHP >= 8.1 for compatibility
- php: '8.0'
symfony_version: '6.2.*' # Requires PHP >= 8.1 for compatibility
- php: '8.0'
symfony_version: '6.3.*' # Requires PHP >= 8.1 for compatibility
- php: '8.0'
symfony_version: '6.4.*' # Requires PHP >= 8.1 for compatibility
steps:
- uses: actions/checkout@v3

Expand All @@ -40,6 +51,13 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install Flex and set Symfony version
if: ${{ matrix.symfony_version }}
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require symfony/flex
composer config extra.symfony.require ${{ matrix.symfony_version }}
- name: Get composer cache directory
id: composer-cache
run: echo "dir="$(composer config cache-files-dir)"" >> $GITHUB_OUTPUT
Expand All @@ -48,11 +66,13 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
key: "key-os-${{ runner.os }}-php-${{matrix.php}}-symfony-${{ matrix.symfony_version }}-composer-${{ hashFiles('composer.json') }}"
restore-keys: "key-os-${{ runner.os }}-php-${{matrix.php}}-symfony-${{ matrix.symfony_version }}-composer-"

- name: Install composer dependencies
run: composer install
run: composer update ${{ matrix.composer-flags }}
env:
SYMFONY_REQUIRE: ${{ matrix.symfony_version }}

- name: Launch test suite
run: make test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
vendor/
composer.lock
.phpunit.result.cache
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"ext-json": "*",
"composer-plugin-api": "^2.3",
"colinodell/indentation": "^1.0",
"symfony/config": "^6.0",
"symfony/dependency-injection": "^6.0",
"symfony/filesystem": "^6.0",
"symfony/finder": "^6.0",
"symfony/options-resolver": "^6.0",
"symfony/validator": "^6.0",
"symfony/var-exporter": "^6.0",
"symfony/yaml": "^6.0"
"symfony/config": "^5.4 || ^6.0",
"symfony/dependency-injection": "^5.4 || ^6.0",
"symfony/filesystem": "^5.4 || ^6.0",
"symfony/finder": "^5.4 || ^6.0",
"symfony/options-resolver": "^5.4 || ^6.0",
"symfony/validator": "^5.4 || ^6.0",
"symfony/var-exporter": "^5.4 || ^6.0",
"symfony/yaml": "^5.4 || ^6.0"
},
"require-dev": {
"composer/composer": "^2.3",
Expand All @@ -24,10 +24,10 @@
"mockery/mockery": "^1.5",
"nikic/php-parser": "^4.15",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpro/grumphp": "^1.13",
"phpro/grumphp": "^1.13 || ^2.4",
"phpunit/phpunit": "^9.5.22",
"roave/security-advisories": "dev-latest",
"symfony/var-dumper": "^6.0",
"symfony/var-dumper": "^5.4 || ^6.0",
"symplify/coding-standard": "^11.0",
"symplify/easy-coding-standard": "^11.0"
},
Expand Down
Loading

0 comments on commit a20e516

Please sign in to comment.