-
Notifications
You must be signed in to change notification settings - Fork 25
94 lines (91 loc) · 3.08 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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