-
Notifications
You must be signed in to change notification settings - Fork 0
300 lines (249 loc) · 10.3 KB
/
test-application.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
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
name: Test application
on:
pull_request:
push:
branches:
- '[0-9]+.x'
- '[0-9]+.[0-9]+'
# automatically cancel previously started workflows when pushing a new commit to a branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
js-css:
name: "Node ${{ matrix.node-version }}"
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- node-version: '18'
styleguide: false
npm-version: '8'
- node-version: '20'
npm-version: '10'
styleguide: true
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Install and configure Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install npm
if: ${{ matrix.npm-version }}
run: npm install --global npm@${{ matrix.npm-version }}
- name: Assert error when using yarn
run: tests/js/check-yarn-warning.sh
- name: Install npm dependencies
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Output versions and installed dependencies
run: |
node --version
npm --version
npm list || true # ignore peer dependency errors
- name: Test JavaScript code
run: npm test -- --maxWorkers=4
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: 'composer:v2'
ini-values: memory_limit=-1
coverage: none
- name: Install php dependencies
run: rm composer.json && composer require friendsofsymfony/jsrouting-bundle:^2.3 --no-interaction
- name: Test application build
run: npm run build
- name: Test Styleguidist build
if: ${{ matrix.styleguide }}
run: npm run styleguide:build
js-lint:
name: "Node Lint"
runs-on: ubuntu-latest
timeout-minutes: 30
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Install and configure Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Assert error when using yarn
run: tests/js/check-yarn-warning.sh
- name: Install npm dependencies
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Lint JavaScript
run: npm run lint:js
- name: Lint SCSS
run: npm run lint:scss
- name: Flow
run: npm run flow -- check
- name: Depcruise
run: npm run depcruise
php:
name: "PHP ${{ matrix.php-version }} (${{ matrix.database }}, ${{ matrix.phpcr-transport }}, ${{ matrix.dependency-versions }})"
runs-on: ubuntu-latest
timeout-minutes: 30
env:
APP_ENV: test
APP_SECRET: a448d1dfcaa563fce56c2fd9981f662b
MAILER_URL: null://localhost
SULU_ADMIN_EMAIL:
PHPCR_TRANSPORT: ${{ matrix.phpcr-transport }}
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
include:
- php-version: '8.2'
database: mysql-57
phpcr-transport: doctrinedbal
dependency-versions: 'lowest'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: disabled
DATABASE_URL: mysql://[email protected]:3306/sulu_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci
- php-version: '8.2'
database: mysql-57
phpcr-transport: jackrabbit
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://[email protected]:3306/sulu_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci
- php-version: '8.3'
database: postgres-14
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, gd'
tools: 'composer:v2'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: postgres://symfony:[email protected]:5432/sulu_test?serverVersion=14.11
DATABASE_CHARSET: UTF8
DATABASE_COLLATE:
- php-version: '8.3'
database: mysql-80
phpcr-transport: doctrinedbal
dependency-versions: 'highest'
php-extensions: 'ctype, iconv, mysql, imagick'
tools: 'composer:v2'
composer-stability: 'dev'
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:[email protected]:3306/sulu_test?serverVersion=8.0
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Start Database
run: |
docker compose -f tests/docker/docker-compose.${{ matrix.database }}.yml up --wait
- name: Start Jackrabbit
if: ${{ matrix.phpcr-transport == 'jackrabbit' }}
run: |
docker compose -f tests/docker/docker-compose.jackrabbit.yml up --wait
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ matrix.php-extensions }}
tools: ${{ matrix.tools }}
ini-values: memory_limit=-1
coverage: none
- name: Remove Lint Tools
# These tools are not required to run tests, so we are removing them to improve dependency resolving and
# testing lowest versions.
run: composer remove "*php-cs-fixer*" "*phpstan*" "*rector*" --dev --no-update
- name: Require jackrabbit dependencies
if: ${{ matrix.phpcr-transport == 'jackrabbit' }}
run: |
composer remove jackalope/jackalope-doctrine-dbal --dev --no-interaction --no-update
composer require jackalope/jackalope-jackrabbit:"^1.4 || ^2.0" --no-interaction --no-update
- name: Install additional lowest dependencies
if: ${{ matrix.dependency-versions == 'lowest' }}
run: |
composer require symfony/swiftmailer-bundle --no-interaction --no-update
- name: Set composer stability
if: ${{ matrix.composer-stability }}
run: composer config minimum-stability ${{ matrix.composer-stability }}
- name: Install composer dependencies
uses: ramsey/composer-install@v1
with:
dependency-versions: ${{matrix.dependency-versions}}
- name: Output versions and installed dependencies
run: |
echo 'PHP Version:'
php --version
echo ''
echo 'PHP Modules:'
php -m
echo ''
echo 'Composer Info:'
composer info
echo ''
echo 'Composer Lock:'
cat composer.lock
- name: Bootstrap test environment
run: composer bootstrap-test-environment
env: ${{ matrix.env }}
- name: Execute test cases
run: time composer test
env: ${{ matrix.env }}
php-lint:
name: "PHP Lint"
runs-on: ubuntu-latest
timeout-minutes: 30
env:
APP_ENV: test
APP_SECRET: a448d1dfcaa563fce56c2fd9981f662b
MAILER_URL: null://localhost
SULU_ADMIN_EMAIL:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Install and configure PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: 'ctype, iconv, mysql'
tools: 'composer:v2'
ini-values: memory_limit=-1
coverage: none
- name: Install composer dependencies
uses: ramsey/composer-install@v1
with:
dependency-versions: highest
- name: Output versions and installed dependencies
run: |
echo 'PHP Version:'
php --version
echo ''
echo 'PHP Modules:'
php -m
echo ''
echo 'Composer Info:'
composer info
echo ''
echo 'Composer Lock:'
cat composer.lock
- name: Lint code
run: composer lint