Skip to content

Commit

Permalink
Symfony 7 compatibility #64
Browse files Browse the repository at this point in the history
  • Loading branch information
williarin authored Mar 28, 2024
2 parents 81d72db + b9546be commit c3c58e3
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 8,398 deletions.
52 changes: 46 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,43 @@ jobs:
fail-fast: true
matrix:
php: ['8.0', '8.1', '8.2', '8.3']
symfony: ['6.0.*', '6.1.*', '6.2.*' , '6.3.*', '6.4.*', '7.0.*']
experimental: [false]
exclude:
- php: '8.0'
symfony: '6.1.*' # Requires PHP >= 8.1 for compatibility
- php: '8.0'
symfony: '6.2.*' # Requires PHP >= 8.1 for compatibility
- php: '8.0'
symfony: '6.3.*' # Requires PHP >= 8.1 for compatibility
- php: '8.0'
symfony: '6.4.*' # Requires PHP >= 8.1 for compatibility
- php: '8.0'
symfony: '7.0.*' # Requires PHP >= 8.2 for compatibility
- php: '8.1'
symfony: '7.0.*' # Requires PHP >= 8.2 for compatibility
include:
- php: '8.4'
symfony: '6.0.*'
experimental: true
- php: '8.4'
symfony: '6.1.*'
experimental: true
- php: '8.4'
symfony: '6.2.*'
experimental: true
- php: '8.4'
symfony: '6.3.*'
experimental: true
- php: '8.4'
symfony: '6.4.*'
experimental: true
- php: '8.4'
symfony: '7.0.*'
experimental: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Spin up Docker containers
run: make reset-containers
Expand All @@ -50,24 +80,34 @@ jobs:
- name: Validate composer.json and composer.lock
run: composer validate

- name: Install Flex and set 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 }}
- name: Get composer cache directory
id: composer-cache
run: echo "dir="$(composer config cache-files-dir)"" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
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 }}-composer-${{ hashFiles('composer.json') }}"
restore-keys: "key-os-${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-"

- name: Install composer dependencies
if: matrix.experimental == false
run: composer install
run: composer update --prefer-stable
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

- name: Install composer dependencies for experimental PHP versions
if: matrix.experimental == true
run: composer install --ignore-platform-req=php+
run: composer update --ignore-platform-req=php+ --prefer-stable
env:
SYMFONY_REQUIRE: ${{ matrix.symfony }}

- name: Install WordPress
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ test/CoverageReport/
*.local
.phpunit.result.cache
docker-compose.override.yml
composer.lock
7 changes: 6 additions & 1 deletion composer-require-checker-config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"symbol-whitelist" : ["property_to_field"]
"symbol-whitelist" : ["property_to_field"],
"scan-files" : [
"vendor/jetbrains/phpstorm-stubs/meta/attributes/ArrayShape.php",
"vendor/jetbrains/phpstorm-stubs/meta/attributes/Deprecated.php",
"vendor/jetbrains/phpstorm-stubs/meta/attributes/ExpectedValues.php"
]
}
27 changes: 14 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,32 @@
],
"require": {
"php": ">=8.0",
"doctrine/annotations": "^2.0",
"doctrine/dbal": "^3.3",
"symfony/config": "^6.0",
"symfony/dependency-injection": "^6.0",
"symfony/options-resolver": "^6.0",
"symfony/property-access": "^6.0",
"symfony/serializer": "^6.0",
"symfony/serializer-pack": "^1.1",
"symfony/string": "^6.0",
"phpdocumentor/reflection-docblock": "^5.3",
"phpstan/phpdoc-parser": "^1.27",
"symfony/config": "^6.0 || ^7.0",
"symfony/dependency-injection": "^6.0 || ^7.0",
"symfony/options-resolver": "^6.0 || ^7.0",
"symfony/property-access": "^6.0 || ^7.0",
"symfony/property-info": "^6.0 || ^7.0",
"symfony/serializer": "^6.0 || ^7.0",
"symfony/string": "^6.0 || ^7.0",
"symfony/translation-contracts": "^3.0"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.23",
"jetbrains/phpstorm-stubs": "^2022.3",
"kubawerlos/php-cs-fixer-custom-fixers": "^3.7",
"maglnet/composer-require-checker": "^4.4",
"phpro/grumphp": "^1.16",
"nikic/php-parser": "^4.19",
"phpro/grumphp": "^1.16 || ^2.0 <2.5",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5",
"rector/rector": "^0.12.13",
"roave/security-advisories": "dev-latest",
"symfony/dotenv": "^6.0",
"symfony/var-dumper": "^6.0",
"symfony/dotenv": "^6.0 || ^7.0",
"symfony/var-dumper": "^6.0 || ^7.0",
"symplify/coding-standard": "^11.0",
"symplify/easy-coding-standard": "^11.0"
},
Expand All @@ -62,9 +66,6 @@
"allow-plugins": {
"ergebnis/composer-normalize": true,
"phpro/grumphp": true
},
"platform": {
"php": "8.0.2"
}
},
"extra": {
Expand Down
Loading

0 comments on commit c3c58e3

Please sign in to comment.