-
Notifications
You must be signed in to change notification settings - Fork 14
340 lines (280 loc) · 12 KB
/
application.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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
name: Application
on:
push: ~
pull_request: ~
release:
types: [created]
schedule:
-
cron: "0 1 * * 6" # Run at 1am every Saturday
jobs:
static-checks:
runs-on: ubuntu-latest
name: "Static checks (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }})"
strategy:
fail-fast: false
matrix:
php: ["8.1"]
symfony: ["~6.1.0"]
node: ["14.x", "16.x"]
mysql: ["5.7"]
include:
- php: "8.1"
symfony: "~6.1.0"
node: "14.x"
mysql: "5.7"
- php: "8.2"
symfony: "~6.2.0"
node: "14.x"
mysql: "5.7"
steps:
-
uses: actions/checkout@v2
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
ini-values: date.timezone=Europe/Warsaw
extensions: intl, gd, mysql, pdo_mysql
tools: symfony
coverage: none
-
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.0"
composer config extra.symfony.require "${{ matrix.symfony }}"
-
name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
-
name: Cache Composer
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-
-
name: Install PHP dependencies
run: composer update --no-interaction --no-scripts
id: end-of-setup
-
name: Validate composer.json
run: composer validate --strict
if: always() && steps.end-of-setup.outcome == 'success'
-
name: Check for security vulnerabilities
run: symfony security:check
if: always() && steps.end-of-setup.outcome == 'success'
-
name: Validate coding standard
run: make validate-coding-standard
if: always() && steps.end-of-setup.outcome == 'success'
-
name: Validate Twig templates
run: make validate-twig || true
if: always() && steps.end-of-setup.outcome == 'success'
-
name: Validate Yaml files
run: make validate-yaml-files
if: always() && steps.end-of-setup.outcome == 'success'
-
name: Validate Package versions
run: make validate-package-version
-
name: Run Psalm
run: vendor/bin/psalm --show-info=false --php-version=${{ matrix.php }}
if: always() && steps.end-of-setup.outcome == 'success'
-
name: Run PHPStan
run: vendor/bin/phpstan analyse
if: always() && steps.end-of-setup.outcome == 'success'
test-application:
runs-on: ubuntu-latest
name: "Test application (PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, Behat driver ${{ matrix.behat_driver }}), MySQL ${{ matrix.mysql }})"
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
php: ["8.1"]
symfony: ["~6.1.0"]
node: ["16.x"]
mysql: ["5.7"]
behat_driver: ["panther"]
include:
- php: "8.1"
symfony: "~6.1.0"
node: "14.x"
mysql: "5.7"
behat_driver: "panther"
- php: "8.2"
symfony: "~6.2.0"
node: "16.x"
mysql: "5.7"
behat_driver: "panther"
- php: "8.2"
symfony: "~6.2.0"
node: "16.x"
mysql: "5.7"
behat_driver: "chrome"
- php: "8.2"
symfony: "~6.2.0"
node: "16.x"
mysql: "5.7"
behat_driver: "chrome_headless"
env:
APP_ENV: test
DATABASE_URL: "mysql://root:[email protected]/monofony?serverVersion=${{ matrix.mysql }}"
steps:
-
uses: actions/checkout@v2
-
name: Shutdown default MySQL
run: sudo service mysql stop
-
name: Setup MySQL
uses: mirromutth/[email protected]
with:
mysql version: "${{ matrix.mysql }}"
mysql root password: "root"
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
ini-values: date.timezone=Europe/Paris, opcache.enable=1, opcache.enable_cli=1, opcache.memory_consumption=512, opcache.max_accelerated_files=65407, opcache.interned_strings_buffer=8, opcache.validate_timestamps=0, opcache.save_comments=1, opcache.fast_shutdown=0
extensions: intl, gd, opcache, mysql, pdo_mysql
tools: symfony
coverage: none
-
name: Restrict Symfony version
if: matrix.symfony != ''
run: |
composer global config --no-plugins allow-plugins.symfony/flex true
composer global require --no-progress --no-scripts --no-plugins "symfony/flex:^2.0"
composer config extra.symfony.require "${{ matrix.symfony }}"
-
name: Install certificates
run: symfony server:ca:install
-
name: Configure Behat driver
run: |
sed -i -e 's/javascript_session: panther/javascript_session: ${{ matrix.behat_driver }}/g' behat.yml.dist
-
name: Run Chrome Headless
run: google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' https://127.0.0.1 > /dev/null 2>&1 &
-
name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
-
name: Cache Composer
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json **/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-
-
name: Install PHP dependencies
run: composer update --no-interaction --no-scripts
-
name: Run Selenium
if: matrix.behat_driver == 'chrome'
run: vendor/bin/selenium-server-standalone -Dwebdriver.chrome.driver=drivers/chromedriver > /dev/null 2>&1 &
-
name: Install Behat driver
if: matrix.behat_driver != 'chrome_headless'
run: vendor/bin/bdi detect drivers
-
name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "${{ matrix.node }}"
-
name: Get Yarn cache directory
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
-
name: Cache Yarn
uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/package.json **/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}-yarn-
-
name: Install JS dependencies
run: yarn install
-
name: Validate Yarn packages
run: yarn check
-
name: Dump the environment
run: |
echo "DATABASE_URL=$DATABASE_URL" >> .env.$APP_ENV
composer dump-env $APP_ENV
-
name: Warmup cache
run: bin/console cache:warmup
-
name: Run webserver
run: symfony server:start --port=8080 --dir=public --daemon
-
name: Prepare application database
run: |
APP_DEBUG=1 bin/console doctrine:database:create -vvv
bin/console doctrine:migrations:migrate -n -vvv
-
name: Build assets
run: |
bin/console assets:install public -vvv
yarn build
-
name: Validate Doctrine mapping
run: make validate-doctrine-schema
if: always() && steps.end-of-setup.outcome == 'success'
-
name: Test provided migrations
run: make test-doctrine-migrations
-
name: Test installer
run: make test-installer
-
name: Load fixtures
run: make test-fixtures
-
name: Run PHPSpec
run: make test-phpspec
-
name: Run PHPUnit
run: make test-phpunit
-
name: Run CLI Behat
run: make test-behat-with-cli
-
name: Run non-JS Behat
run: make test-behat-without-javascript
-
name: Run JS Behat
run: vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --rerun || vendor/bin/behat --colors --strict --no-interaction -vvv -f progress --tags="@javascript&&~@todo&&~@cli" --rerun
-
name: Upload Behat logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: "Behat logs (JS, PHP ${{ matrix.php }})"
path: etc/build/
if-no-files-found: ignore
-
name: Upload Symfony logs
uses: actions/upload-artifact@v2
if: failure()
with:
name: "Symfony logs (JS, PHP ${{ matrix.php }})"
path: var/log/
if-no-files-found: ignore