1
1
version : 2.1
2
2
3
3
orbs :
4
- # codecov: codecov/codecov@1
5
- # https://github.com/codecov/codecov-circleci-orb/pull/17
6
- codecov :
7
- commands :
8
- upload :
9
- parameters :
10
- conf :
11
- description : Used to specify the location of the .codecov.yml config file
12
- type : string
13
- default : " .codecov.yml"
14
- file :
15
- description : Path to the code coverage data file to upload.
16
- type : string
17
- default : " "
18
- flags :
19
- description : Flag the upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
20
- type : string
21
- default : " "
22
- token :
23
- description : Set the private repository token (defaults to environment variable $CODECOV_TOKEN)
24
- type : string
25
- default : ${CODECOV_TOKEN}
26
- upload_name :
27
- description : Custom defined name of the upload. Visible in Codecov UI
28
- type : string
29
- default : ${CIRCLE_BUILD_NUM}
30
- steps :
31
- - when :
32
- condition : << parameters.file >>
33
- steps :
34
- - run :
35
- name : Upload Coverage Results
36
- command : |
37
- curl -s https://codecov.io/bash | bash -s -- \
38
- -f "<< parameters.file >>" \
39
- -t "<< parameters.token >>" \
40
- -n "<< parameters.upload_name >>" \
41
- -y "<< parameters.conf >>" \
42
- -F "<< parameters.flags >>" \
43
- -Z || echo 'Codecov upload failed'
44
- - unless :
45
- condition : << parameters.file >>
46
- steps :
47
- - run :
48
- name : Upload Coverage Results
49
- command : |
50
- curl -s https://codecov.io/bash | bash -s -- \
51
- -t "<< parameters.token >>" \
52
- -n "<< parameters.upload_name >>" \
53
- -y "<< parameters.conf >>" \
54
- -F "<< parameters.flags >>" \
55
- -Z || echo 'Codecov upload failed'
4
+ codecov : codecov/codecov@1
56
5
coveralls :
57
6
commands :
58
7
upload :
@@ -83,20 +32,12 @@ commands:
83
32
- run :
84
33
name : Disable Xdebug PHP extension
85
34
command : sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
86
- install-doctrine-mongodb-odm :
87
- steps :
88
- - run :
89
- name : Install Doctrine MongoDB ODM
90
- command : |
91
- composer require --prefer-dist --no-progress --no-suggest --no-update --ansi \
92
- doctrine/mongodb-odm:^2.0@beta \
93
- doctrine/mongodb-odm-bundle:^4.0@beta \
94
35
install-mongodb-php-extension :
95
36
steps :
96
37
- run :
97
38
name : Install mongodb PHP extension
98
39
command : |
99
- sudo pecl install mongodb
40
+ sudo pecl install mongodb-1.5.4
100
41
sudo docker-php-ext-enable mongodb
101
42
merge-code-coverage-reports :
102
43
parameters :
@@ -274,17 +215,18 @@ jobs:
274
215
working_directory : ~/api-platform/core
275
216
steps :
276
217
- checkout
277
- - restore-composer-cache
278
- - restore-php-cs-fixer-cache
218
+ - install-mongodb-php-extension
279
219
- disable-xdebug-php-extension
280
220
- disable-php-memory-limit
281
221
- update-composer
222
+ - restore-composer-cache
282
223
- run :
283
224
name : Install PHP-CS-Fixer
284
225
command : |
285
226
composer global require --prefer-dist --no-progress --no-suggest --ansi \
286
227
friendsofphp/php-cs-fixer:^2.14
287
228
- save-composer-cache
229
+ - restore-php-cs-fixer-cache
288
230
- run :
289
231
name : Run PHP-CS-Fixer
290
232
command : |
@@ -300,16 +242,15 @@ jobs:
300
242
working_directory : ~/api-platform/core
301
243
steps :
302
244
- checkout
303
- - restore-composer-cache
304
- - restore-phpstan-cache
245
+ - install-mongodb-php-extension
305
246
- disable-xdebug-php-extension
306
247
- disable-php-memory-limit
307
- - install-mongodb-php-extension
308
248
- update-composer
309
- - install-doctrine-mongodb-odm
249
+ - restore-composer-cache
310
250
- update-project-dependencies
311
251
- save-composer-cache
312
252
- clear-test-app-cache
253
+ - restore-phpstan-cache
313
254
- run :
314
255
name : Run PHPStan
315
256
command : vendor/bin/phpstan analyse --ansi
@@ -321,11 +262,11 @@ jobs:
321
262
working_directory : ~/api-platform/core
322
263
steps :
323
264
- checkout
324
- - restore-composer-cache
325
- - restore-npm-cache
265
+ - install-mongodb-php-extension
326
266
- disable-xdebug-php-extension
327
267
- disable-php-memory-limit
328
268
- update-composer
269
+ - restore-composer-cache
329
270
- update-project-dependencies
330
271
- save-composer-cache
331
272
- clear-test-app-cache
@@ -337,6 +278,7 @@ jobs:
337
278
export PARALLEL='-j10% --joblog build/logs/parallel.log --rpl {_}\ s/\\//_/g;'
338
279
phpunit_cmd='phpdbg -qrr vendor/bin/phpunit --coverage-php build/coverage/coverage-{_}.cov --log-junit build/logs/phpunit/{_}.xml --exclude-group mongodb,resource-hog --colors=always {}'
339
280
echo "$split_tests" | parallel "$phpunit_cmd" || echo "$split_tests" | parallel --retry-failed "$phpunit_cmd"
281
+ - restore-npm-cache
340
282
- merge-test-reports :
341
283
dir : build/logs/phpunit
342
284
out : build/logs/phpunit/junit.xml
@@ -367,11 +309,11 @@ jobs:
367
309
working_directory : ~/api-platform/core
368
310
steps :
369
311
- checkout
370
- - restore-composer-cache
371
- - restore-npm-cache
312
+ - install-mongodb-php-extension
372
313
- disable-xdebug-php-extension
373
314
- disable-php-memory-limit
374
315
- update-composer
316
+ - restore-composer-cache
375
317
- update-project-dependencies
376
318
- save-composer-cache
377
319
- clear-test-app-cache
@@ -383,6 +325,7 @@ jobs:
383
325
_f=$(echo "$f" | tr / _)
384
326
FEATURE="${_f}" phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat/"${_f}" --profile=default-coverage --no-interaction "$f"
385
327
done
328
+ - restore-npm-cache
386
329
- merge-test-reports :
387
330
dir : build/logs/behat
388
331
out : build/logs/behat/junit.xml
@@ -411,13 +354,11 @@ jobs:
411
354
working_directory : ~/api-platform/core
412
355
steps :
413
356
- checkout
414
- - restore-composer-cache
415
- - restore-npm-cache
357
+ - install-mongodb-php-extension
416
358
- disable-xdebug-php-extension
417
359
- disable-php-memory-limit
418
- - install-mongodb-php-extension
419
360
- update-composer
420
- - install-doctrine-mongodb-odm
361
+ - restore-composer-cache
421
362
- update-project-dependencies
422
363
- save-composer-cache
423
364
- clear-test-app-cache
@@ -435,6 +376,7 @@ jobs:
435
376
- store_artifacts :
436
377
path : build/logs/clover.xml
437
378
destination : build/logs/clover.xml
379
+ - restore-npm-cache
438
380
- codecov/upload :
439
381
file : build/logs/clover.xml
440
382
flags : phpunit_mongodb
@@ -449,13 +391,11 @@ jobs:
449
391
working_directory : ~/api-platform/core
450
392
steps :
451
393
- checkout
452
- - restore-composer-cache
453
- - restore-npm-cache
394
+ - install-mongodb-php-extension
454
395
- disable-xdebug-php-extension
455
396
- disable-php-memory-limit
456
- - install-mongodb-php-extension
457
397
- update-composer
458
- - install-doctrine-mongodb-odm
398
+ - restore-composer-cache
459
399
- update-project-dependencies
460
400
- save-composer-cache
461
401
- clear-test-app-cache
@@ -465,6 +405,7 @@ jobs:
465
405
command : |
466
406
mkdir -p build/logs/behat
467
407
phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat --profile=mongodb-coverage --no-interaction
408
+ - restore-npm-cache
468
409
- merge-test-reports :
469
410
dir : build/logs/behat
470
411
out : build/logs/behat/junit.xml
@@ -493,11 +434,11 @@ jobs:
493
434
working_directory : ~/api-platform/core
494
435
steps :
495
436
- checkout
496
- - restore-composer-cache
497
- - restore-npm-cache
437
+ - install-mongodb-php-extension
498
438
- disable-xdebug-php-extension
499
439
- disable-php-memory-limit
500
440
- update-composer
441
+ - restore-composer-cache
501
442
- update-project-dependencies
502
443
- save-composer-cache
503
444
- clear-test-app-cache
@@ -507,6 +448,7 @@ jobs:
507
448
command : |
508
449
mkdir -p build/logs/behat
509
450
phpdbg -qrr vendor/bin/behat --format=progress --out=std --format=junit --out=build/logs/behat --profile=elasticsearch-coverage --no-interaction
451
+ - restore-npm-cache
510
452
- merge-test-reports :
511
453
dir : build/logs/behat
512
454
out : build/logs/behat/junit.xml
@@ -530,12 +472,10 @@ jobs:
530
472
531
473
workflows :
532
474
version : 2
533
- lint :
475
+ lint-and-coverage :
534
476
jobs :
535
477
- php-cs-fixer
536
478
- phpstan
537
- test-with-coverage :
538
- jobs :
539
479
- phpunit-coverage
540
480
- behat-coverage
541
481
- phpunit-mongodb-coverage
0 commit comments