-
Notifications
You must be signed in to change notification settings - Fork 60
263 lines (220 loc) · 7.33 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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
name: CI
on:
push:
branches:
- "*.x"
pull_request:
env:
DEPENDENCIES: 'toflar/psr6-symfony-http-cache-store:^2|^3|^4'
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=0'
jobs:
latest:
env:
VARNISH_VERSION: ${{ matrix.varnish-version }}
VARNISH_MODULES_VERSION: ${{ matrix.varnish-modules-version }}
name: PHP ${{ matrix.php }} Varnish ${{ matrix.varnish-version }} SF ${{ matrix.symfony-version }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
varnish-version: ['6.6']
varnish-modules-version: ['0.18.0']
php: ['8.1', '8.2', '8.3']
include:
- php: '8.1'
symfony-version: '6.*'
- php: '8.1'
varnish-version: '7.1'
varnish-modules-version: '0.20.0'
- php: '8.2'
symfony-version: '7.*'
- php: '8.2'
varnish-version: '7.1'
varnish-modules-version: '0.20.0'
- php: '8.3'
symfony-version: '7.*'
- php: '8.3'
varnish-version: '7.1'
varnish-modules-version: '0.20.0'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2, flex
coverage: none
- name: Checkout code
uses: actions/checkout@v4
- name: Cache module compilation
uses: actions/cache@v4
with:
path: /tmp/varnish-modules-${{ matrix.varnish-modules-version }}
key: varnish-modules-${{ matrix.varnish-modules-version }}
- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh
- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-php-${{ matrix.php }}
- name: Install composer dependencies
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version }}
run: |
composer require --no-update ${DEPENDENCIES}
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit
varnish5:
name: PHP ${{ matrix.php }} Legacy Varnish 5
runs-on: ubuntu-20.04
env:
VARNISH_VERSION: '5.1'
VARNISH_MODULES_VERSION: '0.14.0'
strategy:
fail-fast: false
matrix:
include:
- php: '8.1'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- name: Checkout code
uses: actions/checkout@v4
- name: Cache module compilation
uses: actions/cache@v4
with:
path: /tmp/varnish-modules-${{ matrix.varnish-modules-version }}
key: varnish-modules-${{ matrix.varnish-modules-version }}
- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh
- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-legacy
- name: Install composer dependencies
# Lowest discovery can end up with an incompatible psr7 implementation, see discussion in https://github.com/FriendsOfSymfony/FOSHttpCache/pull/567
run: |
composer require --no-update --no-interaction "guzzlehttp/psr7:2.*"
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit
varnish4:
name: PHP ${{ matrix.php }} Legacy Varnish 4
runs-on: ubuntu-20.04
env:
VARNISH_VERSION: '4.1'
VARNISH_MODULES_VERSION: '' # varnish modules compilation fails, not sure why
strategy:
fail-fast: false
matrix:
include:
- php: '8.1'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh
- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-legacy
- name: Install composer dependencies
run: |
composer require --no-update --no-interaction "guzzlehttp/psr7:2.*"
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit
lowest:
name: PHP ${{ matrix.php }} Lowest, Varnish 3
runs-on: ubuntu-20.04
env:
VARNISH_VERSION: '3.0'
VARNISH_MODULES_VERSION: ''
DEPENDENCIES: ''
strategy:
fail-fast: false
matrix:
php: ['8.1']
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish-legacy.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh
- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-lowest
- name: Install composer dependencies
run: |
composer require --no-update --no-interaction "guzzlehttp/psr7:2.*"
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit
coverage:
name: Code Coverage
runs-on: ubuntu-20.04
env:
VARNISH_VERSION: '6.6'
VARNISH_MODULES_VERSION: '0.18.0'
steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: composer:v2
coverage: xdebug
- name: Checkout code
uses: actions/checkout@v4
- name: Cache module compilation
uses: actions/cache@v4
with:
path: /tmp/varnish-modules-${{ matrix.varnish-modules-version }}
key: varnish-modules-${{ matrix.varnish-modules-version }}
- name: Setup Varnish and Nginx
run: |
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-varnish.sh
sh ${GITHUB_WORKSPACE}/.github/workflows/setup-nginx.sh
- name: Cache Vendor
id: cache-vendor
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-vendor-php-8.2
- name: Install dependencies
run: |
composer require "friends-of-phpspec/phpspec-code-coverage:^6.3.0" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: vendor/bin/phpunit --coverage-text --coverage-clover build/coverage.xml