|
1 | 1 | language: php
|
| 2 | + |
2 | 3 | sudo: false
|
3 |
| -dist: trusty |
4 | 4 |
|
5 |
| -php: |
6 |
| - - 7.1 |
7 |
| - - 7.0 |
8 |
| - - 5.6 |
9 |
| - - hhvm |
| 5 | +cache: |
| 6 | + directories: |
| 7 | + - $HOME/.composer/cache/files |
| 8 | + - $HOME/symfony-bridge/.phpunit |
10 | 9 |
|
11 | 10 | env:
|
12 |
| - global: |
13 |
| - - COMPOSER_COMMAND="composer install --prefer-dist" |
14 |
| - - TEST_COMMAND="php vendor/bin/phpunit" |
15 |
| - - COVERAGE=false |
16 |
| - matrix: |
17 |
| - - SYMFONY_VERSION=2.7.* |
18 |
| - - SYMFONY_VERSION=2.8.* |
19 |
| - - SYMFONY_VERSION=3.1.* |
20 |
| - - SYMFONY_VERSION=3.2.* |
| 11 | + global: |
| 12 | + - TEST_COMMAND="composer test" |
| 13 | + - SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit" |
| 14 | + - SYMFONY_DEPRECATIONS_HELPER="weak" |
21 | 15 |
|
22 | 16 | branches:
|
23 |
| - except: |
24 |
| - - /^analysis-.*$/ |
25 |
| - - /^patch-.*$/ |
| 17 | + except: |
| 18 | + - /^analysis-.*$/ |
26 | 19 |
|
27 | 20 | matrix:
|
28 |
| - fast_finish: true |
29 |
| - include: |
30 |
| - - php: 5.6 |
31 |
| - env: COMPOSER_COMMAND="composer update --prefer-lowest --prefer-stable" COVERAGE=true TEST_COMMAND="php -dzend_extension=xdebug.so vendor/bin/phpunit --coverage-clover=coverage.xml" SYMFONY_VERSION=2.7.* |
| 21 | + fast_finish: true |
| 22 | + include: |
| 23 | + # Minimum supported Symfony version and latest PHP version |
| 24 | + - php: 7.2 |
| 25 | + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" |
| 26 | + - php: 5.6 |
| 27 | + env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" |
32 | 28 |
|
33 |
| -cache: |
34 |
| - directories: |
35 |
| - - $HOME/.composer/cache |
| 29 | + # Test the latest stable release |
| 30 | + - php: 5.6 |
| 31 | + - php: 7.0 |
| 32 | + - php: 7.1 |
| 33 | + - php: 7.2 |
| 34 | + env: COVERAGE=true TEST_COMMAND="composer test-ci" |
| 35 | + |
| 36 | + # Test LTS versions |
| 37 | + - php: 7.2 |
| 38 | + env: DEPENDENCIES="dunglas/symfony-lock:^2 symfony/property-access:^2.8" |
| 39 | + - php: 7.2 |
| 40 | + env: DEPENDENCIES="dunglas/symfony-lock:^3" |
| 41 | + - php: 7.2 |
| 42 | + env: DEPENDENCIES="dunglas/symfony-lock:^4" |
| 43 | + |
| 44 | + # Latest commit to master |
| 45 | + - php: 7.2 |
| 46 | + env: STABILITY="dev" |
| 47 | + |
| 48 | + allow_failures: |
| 49 | + # dev stability is allowed to fail. |
| 50 | + - env: STABILITY="dev" |
36 | 51 |
|
37 | 52 | before_install:
|
38 |
| - - if [[ $TRAVIS_PHP_VERSION != 'hhvm' ]]; then phpenv config-rm xdebug.ini; fi; |
39 |
| - - pip install --user codecov |
40 |
| - - composer require symfony/symfony:${SYMFONY_VERSION} --no-update |
| 53 | + - if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi |
| 54 | + - if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi; |
| 55 | + - if ! [ -v "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi; |
| 56 | + - pip install --user codecov |
41 | 57 |
|
42 | 58 | install:
|
43 |
| - - travis_retry ${COMPOSER_COMMAND} --no-interaction |
| 59 | + # To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355 |
| 60 | + - if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi |
| 61 | + - composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction |
| 62 | + - vendor/bin/simple-phpunit install |
44 | 63 |
|
45 | 64 | script:
|
46 |
| - - $TEST_COMMAND |
| 65 | + - composer validate --strict --no-check-lock |
| 66 | + - $TEST_COMMAND |
47 | 67 |
|
48 | 68 | after_success:
|
49 |
| - - if [[ "$COVERAGE" = true ]]; then codecov; fi |
| 69 | + - if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi |
| 70 | + - if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi |
| 71 | + - if [[ "$COVERAGE" = true ]]; then codecov; fi |
| 72 | + |
| 73 | +after_script: |
| 74 | + - wget http://tnyholm.se/reporter.phar |
| 75 | + - php reporter.phar build:upload |
0 commit comments