-
Notifications
You must be signed in to change notification settings - Fork 379
137 lines (116 loc) · 4.17 KB
/
phpunit.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: PHPUnit
on:
pull_request:
push:
branches:
- 1.x
- 2.x
jobs:
phpunit:
name: "PHP ${{ matrix.php }} + ${{ matrix.dependencies }} dependencies + Symfony ${{ matrix.symfony }}"
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
dependencies: [highest]
symfony: ['*']
stability: ['stable']
include:
# Minimum supported dependencies with the oldest supported PHP version
- php: '7.2'
dependencies: lowest
symfony: '*'
stability: 'stable'
# Minimum supported dependencies with the latest supported PHP version
- php: '8.2'
dependencies: lowest
symfony: '*'
stability: 'stable'
# Test each supported Symfony version with the lowest supported PHP version
- php: '7.2'
dependencies: highest
symfony: '3.4.*'
stability: 'stable'
- php: '7.2'
dependencies: highest
symfony: '4.4.*'
stability: 'stable'
- php: '7.2'
dependencies: highest
symfony: '5.3.*'
stability: 'stable'
# Test Symfony 6.4 dev version
- php: '8.2'
dependencies: highest
symfony: '6.4.*'
stability: 'dev'
# Test Symfony 7.0 dev version
- php: '8.2'
dependencies: highest
symfony: '7.0.*'
stability: 'dev'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure coverage driver
id: coverage
run: echo ::set-output name=driver::xdebug
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ steps.coverage.outputs.driver }}
extensions: gd, imagick
- name: Require Symfony version
if: matrix.symfony != '*'
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-interaction --no-progress symfony/flex
composer config extra.symfony.require ${{ matrix.symfony }}
- name: Remove non-compatible dependencies with Symfony 7
if: matrix.symfony == '7.0.*'
run: |
composer remove enqueue/enqueue-bundle symfony/templating --dev --no-update
- name: Set minimum-stability
run: composer config minimum-stability ${{ matrix.stability }}
# Incompatible with symfony/framework-bundle v3
- name: Remove symfony/messenger
if: ${{ matrix.php == '7.2' && matrix.symfony == '3.4.*' }}
run: composer remove --dev --no-update symfony/messenger
- name: Update project dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ matrix.dependencies }}
- name: Cache PHPUnit
uses: actions/cache@v3
with:
path: vendor/bin/.phpunit
key: ${{ runner.os }}-phpunit-${{ matrix.php }}
- name: Install PHPUnit
run: vendor/bin/simple-phpunit install
- name: Run PHPUnit tests
env:
SYMFONY_DEPRECATIONS_HELPER: max[self]=0
run: vendor/bin/simple-phpunit -v
- name: Install php-coveralls
run: composer global require --no-interaction --no-progress php-coveralls/php-coveralls
- name: Upload coverage results to Coveralls
uses: nick-invision/retry@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: "PHP ${{ matrix.php }} + ${{ matrix.dependencies }} dependencies + Symfony ${{ matrix.symfony }}"
with:
timeout_seconds: 60
max_attempts: 3
command: php-coveralls -x var/build/clover.xml -o var/build/upload.json -v
coveralls-finish:
needs: [phpunit]
runs-on: ubuntu-20.04
steps:
- name: Notify Coveralls when build is finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true