|
| 1 | +# See: https://symfony.com/doc/current/bundles/best_practices.html#continuous-integration |
1 | 2 | language: php |
| 3 | +sudo: false |
| 4 | +cache: |
| 5 | + directories: |
| 6 | + - $HOME/.composer/cache/files |
| 7 | + - $HOME/symfony-bridge/.phpunit |
2 | 8 |
|
3 | | -php: |
4 | | - - 7.0 |
5 | | - - 7.1 |
6 | | - - 7.2 |
7 | | - - 7.3 |
| 9 | +env: |
| 10 | + global: |
| 11 | + - PHPUNIT_FLAGS="-v" |
| 12 | + - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit" |
8 | 13 |
|
9 | 14 | matrix: |
10 | | - allow_failures: |
11 | | - - php: 7.3 |
| 15 | + fast_finish: true |
| 16 | + include: |
| 17 | + # Test the latest stable release |
| 18 | + - php: 7.0 |
| 19 | + - php: 7.1 |
| 20 | + - php: 7.2 |
| 21 | + env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text" |
| 22 | + |
| 23 | + # Test LTS versions. This makes sure we do not use Symfony packages with version greater |
| 24 | + # than 2 or 3 respectively. Read more at https://github.com/symfony/lts |
| 25 | + - php: 7.2 |
| 26 | + env: DEPENDENCIES="symfony/lts:^3" |
| 27 | + |
| 28 | + # Latest commit to master |
| 29 | + - php: 7.2 |
| 30 | + env: STABILITY="dev" |
12 | 31 |
|
13 | | -env: |
14 | | - - SYMFONY_VERSION=2.8.* |
15 | | - - SYMFONY_VERSION=3.4.* |
| 32 | + allow_failures: |
| 33 | + # Dev-master is allowed to fail. |
| 34 | + - env: STABILITY="dev" |
16 | 35 |
|
17 | 36 | before_install: |
18 | | - - phpenv config-add travis/z_php.ini |
| 37 | + - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi |
| 38 | + - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; |
| 39 | + - if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; |
19 | 40 |
|
20 | | -before_script: |
21 | | - - composer install --prefer-dist --no-interaction |
| 41 | +install: |
| 42 | + # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 |
| 43 | + - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi |
| 44 | + - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction |
| 45 | + - ./vendor/bin/simple-phpunit install |
22 | 46 |
|
23 | 47 | script: |
24 | | - - SYMFONY_PHPUNIT_VERSION=6.5 SYMFONY_DEPRECATIONS_HELPER=weak_vendors bin/simple-phpunit --coverage-text |
| 48 | + - composer validate --strict --no-check-lock |
| 49 | + # simple-phpunit is the PHPUnit wrapper provided by the PHPUnit Bridge component and |
| 50 | + # it helps with testing legacy code and deprecations (composer require symfony/phpunit-bridge) |
| 51 | + - SYMFONY_DEPRECATIONS_HELPER="weak_vendors" ./vendor/bin/simple-phpunit $PHPUNIT_FLAGS |
25 | 52 |
|
26 | 53 | notifications: |
27 | 54 | email: |
28 | 55 | recipients: |
29 | 56 | - si-integration@smartandco.com |
30 | 57 | on_success: change |
31 | 58 | on_failure: always |
32 | | - |
|
0 commit comments