-
-
Notifications
You must be signed in to change notification settings - Fork 329
80 lines (68 loc) · 2.41 KB
/
ci.yaml
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
name: CI
on:
pull_request:
push:
branches: [ master, main ]
schedule:
- cron: '45 4 1 * *'
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.1'
- '8.2'
- '8.3'
symfony-versions:
- false
- '6.4.*'
- '7.*.*'
exclude:
- php: '8.1'
symfony-versions: '7.*.*'
name: PHP ${{ matrix.php }} ${{ matrix.description }} - ${{ matrix.symfony-versions }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.composer/cache/files
key: ${{ matrix.php }}-${{ matrix.symfony-versions }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install dependencies
run: composer install
- name: Setup Symfony version
run: |
composer bin symfony require "symfony/framework-bundle:${{ matrix.symfony-versions }}" --no-update
composer bin symfony require "symfony/serializer:${{ matrix.symfony-versions }}" --no-update
if: matrix.symfony-versions
- name: Install bin dependencies
run: composer bin symfony install
if: matrix.symfony-versions
- name: Run PHPUnit tests
run: bin/phpunit
if: false == matrix.symfony-versions
- name: Run Symfony tests
run: bin/phpunit --configuration phpunit_symfony.xml.dist
if: matrix.symfony-versions
# This is a "trick", a meta task which does not change, and we can use in
# the protected branch rules as opposed to the tests one above which
# may change regularly.
validate-tests:
name: Tests status
runs-on: ubuntu-latest
needs:
- tests
if: always()
steps:
- name: Successful run
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1