-
-
Notifications
You must be signed in to change notification settings - Fork 223
530 lines (424 loc) · 19.1 KB
/
tests.yaml
File metadata and controls
530 lines (424 loc) · 19.1 KB
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
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
name: Tests
on:
pull_request:
paths-ignore:
- 'src/*/doc/**'
- 'src/**/*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
REQUIRED_PHP_EXTENSIONS: 'mongodb, redis'
jobs:
# ===========================================
# Build Matrix
# ===========================================
matrix:
name: Matrix
uses: ./.github/workflows/build-matrix.yaml
# ===========================================
# Unit Tests
# ===========================================
packages:
name: Unit / ${{ matrix.package.type }} / ${{ matrix.package.name }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}${{ matrix.symfony-version && format(' / Symfony {0}', matrix.symfony-version) || '' }}
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
package: ${{ fromJson(needs.matrix.outputs.packages) }}
php-version: ['8.2', '8.5']
dependency-version: ['']
symfony-version: ['']
include: ${{ fromJson(needs.matrix.outputs.packages-include) }}
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.4' }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure environment
run: |
echo COLUMNS=120 >> $GITHUB_ENV
[ 'lowest' = '${{ matrix.dependency-version }}' ] && echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV || true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: flex
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
# deptrac does not support Symfony 5.4
- name: Remove deptrac for unsupported Symfony versions
if: startsWith(matrix.symfony-version, '5.4')
run: composer remove --dev deptrac/deptrac --no-update
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build packages
run: php .github/build-packages.php
- name: Clean vendor folder
run: rm -rf vendor
- name: Install dependencies
uses: ramsey/composer-install@v4
with:
working-directory: src/${{ matrix.package.path }}
dependency-versions: ${{ matrix.dependency-version || 'highest' }}
- name: Run PHPUnit
run: cd src/${{ matrix.package.path }} && vendor/bin/phpunit
store-bridges:
name: Unit / Store / ${{ matrix.bridge.bridge }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.store-bridges-include) }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure environment
run: |
echo COLUMNS=120 >> $GITHUB_ENV
[ 'lowest' = '${{ matrix.dependency-version }}' ] && echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV || true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: flex
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build packages
run: php .github/build-packages.php
- name: Isolate Bridge
uses: ./.github/actions/isolate-bridge
with:
component: ${{ matrix.bridge.component }}
bridge: ${{ matrix.bridge.bridge }}
target: tmp
- name: Install sqlite-vec extension
if: matrix.bridge.bridge == 'Sqlite'
run: |
curl -L https://github.com/asg017/sqlite-vec/releases/download/v0.1.9/install.sh | sh
echo "SQLITE_VEC_PATH=$(pwd)/vec0.so" >> $GITHUB_ENV
- name: Install dependencies
uses: ramsey/composer-install@v4
with:
working-directory: tmp/${{ matrix.bridge.component }}/src/Bridge/${{ matrix.bridge.bridge }}
dependency-versions: ${{ matrix.dependency-version }}
- name: Run PHPUnit
run: cd tmp/${{ matrix.bridge.component }}/src/Bridge/${{ matrix.bridge.bridge }} && vendor/bin/phpunit --exclude-group integration
store-bridges-integration:
name: Integration / Store / ${{ matrix.bridge }}
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bridge: ${{ fromJson(needs.matrix.outputs.store-bridges-integration) }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: flex
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build packages
run: php .github/build-packages.php
- name: Isolate Bridge
uses: ./.github/actions/isolate-bridge
with:
component: store
bridge: ${{ matrix.bridge }}
target: tmp
- name: Install sqlite-vec extension
if: matrix.bridge == 'Sqlite'
run: |
curl -L https://github.com/asg017/sqlite-vec/releases/download/v0.1.9/install.sh | sh
echo "SQLITE_VEC_PATH=$(pwd)/vec0.so" >> $GITHUB_ENV
- name: Install dependencies
uses: ramsey/composer-install@v4
with:
working-directory: tmp/store/src/Bridge/${{ matrix.bridge }}
- name: Start Docker services
working-directory: tmp/store/src/Bridge/${{ matrix.bridge }}
run: docker compose up -d --wait || true
- name: Wait for services to be ready
run: sleep 15
- name: Run integration tests
run: cd tmp/store/src/Bridge/${{ matrix.bridge }} && vendor/bin/phpunit --group integration
- name: Stop Docker services
working-directory: tmp/store/src/Bridge/${{ matrix.bridge }}
run: docker compose down || true
message-store-bridges:
name: Unit / Message Store / ${{ matrix.bridge.bridge }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.message-store-bridges-include) }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure environment
run: |
echo COLUMNS=120 >> $GITHUB_ENV
[ 'lowest' = '${{ matrix.dependency-version }}' ] && echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV || true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: flex
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build packages
run: php .github/build-packages.php
- name: Isolate Bridge
uses: ./.github/actions/isolate-bridge
with:
component: ${{ matrix.bridge.component }}
bridge: ${{ matrix.bridge.bridge }}
target: tmp
- name: Install dependencies
uses: ramsey/composer-install@v4
with:
working-directory: tmp/${{ matrix.bridge.component }}/src/Bridge/${{ matrix.bridge.bridge }}
dependency-versions: ${{ matrix.dependency-version }}
- name: Run PHPUnit
run: cd tmp/${{ matrix.bridge.component }}/src/Bridge/${{ matrix.bridge.bridge }} && vendor/bin/phpunit
tool-bridges:
name: Unit / Tool / ${{ matrix.bridge.bridge }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.tool-bridges-include) }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure environment
run: |
echo COLUMNS=120 >> $GITHUB_ENV
[ 'lowest' = '${{ matrix.dependency-version }}' ] && echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV || true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: flex
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build packages
run: php .github/build-packages.php
- name: Isolate Bridge
uses: ./.github/actions/isolate-bridge
with:
component: ${{ matrix.bridge.component }}
bridge: ${{ matrix.bridge.bridge }}
target: tmp
- name: Install dependencies
uses: ramsey/composer-install@v4
with:
working-directory: tmp/${{ matrix.bridge.component }}/src/Bridge/${{ matrix.bridge.bridge }}
dependency-versions: ${{ matrix.dependency-version }}
- name: Run PHPUnit
run: cd tmp/${{ matrix.bridge.component }}/src/Bridge/${{ matrix.bridge.bridge }} && vendor/bin/phpunit
platform-bridges:
name: Unit / Platform / ${{ matrix.bridge.bridge }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.platform-bridges-include) }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure environment
run: |
echo COLUMNS=120 >> $GITHUB_ENV
[ 'lowest' = '${{ matrix.dependency-version }}' ] && echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV || true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: flex
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build packages
run: php .github/build-packages.php
- name: Isolate Bridge
uses: ./.github/actions/isolate-bridge
with:
component: platform
bridge: ${{ matrix.bridge.bridge }}
target: tmp
- name: Install dependencies
uses: ramsey/composer-install@v4
with:
working-directory: tmp/platform/src/Bridge/${{ matrix.bridge.bridge }}
dependency-versions: ${{ matrix.dependency-version }}
- name: Run PHPUnit
run: cd tmp/platform/src/Bridge/${{ matrix.bridge.bridge }} && vendor/bin/phpunit
mate-bridges:
name: Unit / Mate / ${{ matrix.bridge.bridge }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}
needs: matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.matrix.outputs.mate-bridges-include) }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Configure environment
run: |
echo COLUMNS=120 >> $GITHUB_ENV
[ 'lowest' = '${{ matrix.dependency-version }}' ] && echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV || true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: flex
extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }}
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build packages
run: php .github/build-packages.php
- name: Isolate Bridge
uses: ./.github/actions/isolate-bridge
with:
component: mate
bridge: ${{ matrix.bridge.bridge }}
target: tmp
- name: Install dependencies
uses: ramsey/composer-install@v4
with:
working-directory: tmp/mate/src/Bridge/${{ matrix.bridge.bridge }}
dependency-versions: ${{ matrix.dependency-version }}
- name: Run PHPUnit
run: cd tmp/mate/src/Bridge/${{ matrix.bridge.bridge }} && vendor/bin/phpunit
demo:
name: Integration / Demo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: flex
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build root packages
run: php .github/build-packages.php
- name: Install demo dependencies
uses: ramsey/composer-install@v4
with:
composer-options: "--no-scripts"
working-directory: demo
- name: Link local packages
working-directory: demo
run: ../link
- run: composer run-script auto-scripts --no-interaction
working-directory: demo
- run: bin/console lint:container
working-directory: demo
- name: Run demo tests
working-directory: demo
run: vendor/bin/phpunit
demo-no-dev:
name: Integration / Demo (no-dev)
needs: demo
runs-on: ubuntu-latest
env:
APP_ENV: prod
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: flex
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build root packages
run: php .github/build-packages.php
- name: Install demo dependencies (no-dev)
uses: ramsey/composer-install@v4
with:
composer-options: "--no-scripts --no-dev"
working-directory: demo
- name: Link local packages
working-directory: demo
run: ../link
- run: composer run-script auto-scripts --no-interaction
working-directory: demo
- run: bin/console lint:container
working-directory: demo
- run: bin/console cache:clear
working-directory: demo
examples:
name: Integration / Examples / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}${{ matrix.symfony-version && format(' / Symfony {0}', matrix.symfony-version) || '' }}
needs: demo
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.5']
dependency-version: ['']
symfony-version: ['']
include:
# lowest deps
- php-version: '8.2'
dependency-version: 'lowest'
# LTS version of Symfony
- php-version: '8.2'
symfony-version: '7.4.*'
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.4' }}
steps:
- uses: actions/checkout@v6
- name: Up the examples services
working-directory: examples
run: docker compose up -d meilisearch mongodb pogocache redis surrealdb
- name: Configure environment
run: |
echo COLUMNS=120 >> $GITHUB_ENV
echo COMPOSER_UP='composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest --prefer-stable' || '' }} --no-progress --no-interaction --ansi' >> $GITHUB_ENV
echo PHPUNIT='vendor/bin/phpunit' >> $GITHUB_ENV
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
PACKAGES=$(find src/ -mindepth 2 -type f -name composer.json -not -path "*/vendor/*" -printf '%h\n' | sed 's/^src\///' | grep -Ev "examples" | sort | tr '\n' ' ')
echo "Packages: $PACKAGES"
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: flex
extensions: "${{ env.REQUIRED_PHP_EXTENSIONS }}"
# deptrac does not support Symfony 5.4, 6.4, and 8 yet
- name: Remove deptrac for unsupported Symfony versions
if: startsWith(matrix.symfony-version, '5.4')
run: composer remove --dev deptrac/deptrac --no-update
- name: Install root dependencies
uses: ramsey/composer-install@v4
- name: Build root packages
run: php .github/build-packages.php
- name: Install examples dependencies
uses: ramsey/composer-install@v4
with:
working-directory: examples
- name: Link local components to examples
run: ./link examples
- name: Run command example
working-directory: examples
run: php commands/message-stores.php