Skip to content

Commit 47c6dda

Browse files
committed
Updated travis yml to properly test different symfony versions
1 parent baadcd4 commit 47c6dda

File tree

1 file changed

+32
-20
lines changed

1 file changed

+32
-20
lines changed

.travis.yml

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,9 @@ cache:
66
directories:
77
- $HOME/.composer/cache/files
88

9-
php:
10-
- 5.5
11-
- 5.6
12-
- 7.0
13-
- 7.1
14-
- 7.2
15-
169
env:
1710
global:
18-
- TEST_COMMAND="composer test"
11+
- TEST_COMMAND="./vendor/bin/simple-phpunit"
1912

2013
branches:
2114
except:
@@ -24,26 +17,45 @@ branches:
2417
matrix:
2518
fast_finish: true
2619
include:
20+
# Minimum supported PHP and Symfony version
21+
- php: 7.1
22+
env: DEPENDENCIES="minimum" COVERAGE=true TEST_COMMAND="composer test-ci" SYMFONY_DEPRECATIONS_HELPER="weak"
23+
24+
# Test the latest stable release
2725
- php: 5.5
28-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
29-
- php: 7.2
30-
env: DEPENDENCIES=dev
31-
- php: hhvm
32-
dist: trusty
33-
# Test against LTS versions
26+
- php: 5.6
3427
- php: 7.0
35-
env: SYMFONY_VERSION=2.8.*
28+
- php: 7.1
29+
30+
# Test LTS versions
31+
- php: 5.5
32+
env: DEPENDENCIES="symfony/lts:v2"
33+
- php: 5.5
34+
env: DEPENDENCIES="symfony/lts:v3"
35+
36+
# Latest commit to master
37+
- php: 7.1
38+
env: DEPENDENCIES="dev"
39+
40+
allow_failures:
41+
# Latest beta is allowed to fail.
42+
- php: 7.1
43+
env: DEPENDENCIES="dev"
3644

3745
before_install:
38-
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
39-
- if [ "$DEPENDENCIES" = "dev" ]; then sed -i '/prefer-stable/d' composer.json; fi;
40-
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
41-
- if [ $COVERAGE != true ]; then phpenv config-rm xdebug.ini; fi;
46+
- composer require --no-update "symfony/phpunit-bridge:^3.3 || ^4"
47+
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
48+
- if [ "$DEPENDENCIES" = "minimum" ]; then COMPOSER_FLAGS="--prefer-stable --prefer-lowest"; fi;
49+
- if [ "$DEPENDENCIES" = "dev" ]; then composer config minimum-stability dev; fi;
50+
- if [[ $DEPENDENCIES == *"/"* ]]; then composer require --no-update $DEPENDENCIES; fi;
4251

4352
install:
44-
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
53+
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
54+
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
55+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
4556

4657
script:
58+
- composer validate --strict --no-check-lock
4759
- $TEST_COMMAND
4860

4961
after_success:

0 commit comments

Comments
 (0)