CI #863
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
- '[0-9].[0-9]' | |
tags: | |
- '*' | |
pull_request: ~ | |
schedule: | |
# Every Sunday at 02:00 | |
- cron: 0 2 * * 0 | |
workflow_dispatch: ~ | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: Tests PHP ${{ matrix.php }} (Symfony ${{ matrix.symfony }}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php: | |
# Only PHP supported versions: https://www.php.net/supported-versions.php | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
symfony: | |
# Only Symfony supported versions: https://symfony.com/releases | |
# API Platform 3.* only supports Symfony >= 6.1 | |
- '6.4.*' | |
- '7.0.*' | |
include: | |
# Ensure the bundle is bootable | |
- php: '8.3' | |
symfony: '6.4.*' | |
bootable: true | |
quality: true | |
- php: '8.3' | |
symfony: '7.0.*' | |
bootable: true | |
quality: true | |
exclude: | |
# Symfony 7 requires php 8.2 | |
- php: '8.1' | |
symfony: '7.0.*' | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer:v2, flex, php-cs-fixer | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Configure Symfony | |
run: composer config extra.symfony.require "${{ matrix.symfony }}" | |
- 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 | |
run: | | |
mkdir -p features/app/cache/test/doctrine/orm/Proxies features/app/logs | |
vendor/bin/behat | |
- name: Run Behat tests with jms/serializer-bundle | |
run: | | |
mkdir -p features/app/cache/jmsserializer/doctrine/orm/Proxies features/app/logs | |
vendor/bin/behat -p jmsserializer |