From 1944bcc3ba4354abbf6d4f2898d6d2adb4b0e579 Mon Sep 17 00:00:00 2001 From: Vincent Chalamon <407859+vincentchalamon@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:44:44 +0200 Subject: [PATCH] chore: update GitHub Actions workflow and fix compatibility with API Platform --- .github/workflows/ci.yml | 48 ++++++++++++++------------- composer.json | 2 +- features/bootstrap/FeatureContext.php | 2 -- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c64c47..88cf7e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ concurrency: jobs: tests: - name: Tests PHP ${{ matrix.php }} (Symfony ${{ matrix.symfony }}) + name: Tests PHP ${{ matrix.php }} / Symfony ${{ matrix.symfony }} / API Platform ${{ matrix.api-platform }} runs-on: ubuntu-latest strategy: matrix: @@ -30,23 +30,23 @@ jobs: - '8.3' symfony: # Only Symfony supported versions: https://symfony.com/releases - # API Platform 3.* only supports Symfony >= 6.1 - '6.4.*' - - '7.0.*' + - '7.1.*' + api-platform: + - '^3.4' + - '^4.0' include: - # Ensure the bundle is bootable - php: '8.3' - symfony: '6.4.*' - bootable: true - quality: true - - php: '8.3' - symfony: '7.0.*' + symfony: '7.1.*' + api-platform: '^4.0' bootable: true quality: true exclude: # Symfony 7 requires php 8.2 - php: '8.1' - symfony: '7.0.*' + symfony: '7.1.*' + - php: '8.2' + symfony: '7.1.*' fail-fast: false steps: - name: Checkout @@ -67,21 +67,10 @@ jobs: restore-keys: ${{ runner.os }}-composer- - name: Configure Symfony run: composer config extra.symfony.require "${{ matrix.symfony }}" + - name: Configure API Platform + run: composer require --dev "api-platform/core:${{ matrix.api-platform }}" - name: Update project dependencies run: composer update --no-progress --ansi --prefer-stable --prefer-dist --no-scripts - - name: Bundle is bootable - if: ${{ matrix.bootable && github.event_name == 'push' && github.ref_name == 'main' }} - run: | - composer create-project "symfony/skeleton:${{ matrix.symfony }}" flex - cd flex - composer config extra.symfony.allow-contrib true - composer req --ignore-platform-reqs tilleuls/forgot-password-bundle:dev-${{ github.ref_name }} - - name: Run php-cs-fixer tests - if: matrix.quality - env: - # PHP CS Fixer does not support PHP 8.3 yet - PHP_CS_FIXER_IGNORE_ENV: 1 - run: php-cs-fixer fix --diff --dry-run - name: Run PHPUnit tests run: vendor/bin/simple-phpunit --colors=always --testdox - name: Run Behat tests @@ -92,3 +81,16 @@ jobs: run: | mkdir -p features/app/cache/jmsserializer/doctrine/orm/Proxies features/app/logs vendor/bin/behat -p jmsserializer + - name: Run php-cs-fixer tests + if: matrix.quality + env: + # PHP CS Fixer does not support PHP 8.3 yet + PHP_CS_FIXER_IGNORE_ENV: 1 + run: php-cs-fixer fix --diff --dry-run + - name: Bundle is bootable + if: ${{ matrix.bootable && github.event_name == 'push' && github.ref_name == 'main' }} + run: | + composer create-project "symfony/skeleton:${{ matrix.symfony }}" flex + cd flex + composer config extra.symfony.allow-contrib true + composer req --ignore-platform-reqs tilleuls/forgot-password-bundle:dev-${{ github.ref_name }} diff --git a/composer.json b/composer.json index b610a4b..e2206f1 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ }, "require-dev": { "ext-json": "*", - "api-platform/core": "^3.0", + "api-platform/core": "^3.0 || ^4.0", "behat/behat": "^3.1", "dg/bypass-finals": "^1.1", "doctrine/data-fixtures": "^1.2", diff --git a/features/bootstrap/FeatureContext.php b/features/bootstrap/FeatureContext.php index 6f376e0..6348eb6 100644 --- a/features/bootstrap/FeatureContext.php +++ b/features/bootstrap/FeatureContext.php @@ -499,7 +499,6 @@ private function getOpenApiPaths(): array 'required' => true, ], ], - 'parameters' => [], ], '/api/forgot-password/{tokenValue}' => [ 'ref' => 'ForgotPassword', @@ -586,7 +585,6 @@ private function getOpenApiPaths(): array 'required' => true, ], ], - 'parameters' => [], ], ];