Skip to content

CI

CI #780

Workflow file for this run

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'
symfony:
# Only Symfony supported versions: https://symfony.com/releases
# API Platform 3.* only supports Symfony >= 6.1
- '6.3.*'
include:
# Ensure the bundle is bootable
- php: '8.2'
symfony: '6.3.*'
bootable: true
quality: true
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@v3
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.2 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