Skip to content

Commit

Permalink
chore: update GitHub Actions workflow and fix compatibility with API …
Browse files Browse the repository at this point in the history
…Platform
  • Loading branch information
vincentchalamon committed Sep 24, 2024
1 parent f1506ec commit 1944bcc
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 0 additions & 2 deletions features/bootstrap/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ private function getOpenApiPaths(): array
'required' => true,
],
],
'parameters' => [],
],
'/api/forgot-password/{tokenValue}' => [
'ref' => 'ForgotPassword',
Expand Down Expand Up @@ -586,7 +585,6 @@ private function getOpenApiPaths(): array
'required' => true,
],
],
'parameters' => [],
],
];

Expand Down

0 comments on commit 1944bcc

Please sign in to comment.