Skip to content

Commit 6d6b78d

Browse files
authored
Improve travis (#19)
* Improve travis * Require phpunit bridge
1 parent 3d16154 commit 6d6b78d

File tree

2 files changed

+45
-18
lines changed

2 files changed

+45
-18
lines changed

.travis.yml

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,57 @@ branches:
99
- /^analysis-.*$/
1010
- /^patch-.*$/
1111

12-
php:
13-
- 5.4
14-
- 5.5
15-
- 5.6
16-
- 7.0
17-
- 7.1
18-
1912
env:
2013
global:
2114
- TEST_COMMAND="composer test"
2215

2316
matrix:
24-
fast_finish: true
25-
include:
26-
- php: 5.4
27-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
28-
- php: hhvm
29-
dist: trusty
17+
fast_finish: true
18+
include:
19+
# Test with lowest dependencies
20+
- php: 7.1
21+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
22+
- php: 5.5
23+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
24+
25+
# Test the latest stable release
26+
- php: 5.4
27+
- php: 5.5
28+
- php: 5.6
29+
- php: 7.0
30+
- php: 7.1
31+
- php: 7.2
32+
env: COVERAGE=true TEST_COMMAND="composer test-ci"
33+
34+
# Force some major versions of Symfony
35+
- php: 7.2
36+
env: DEPENDENCIES="dunglas/symfony-lock:^2"
37+
- php: 7.2
38+
env: DEPENDENCIES="dunglas/symfony-lock:^3"
39+
- php: 7.2
40+
env: DEPENDENCIES="dunglas/symfony-lock:^4"
41+
42+
# Latest commit to master
43+
- php: 7.2
44+
env: STABILITY="dev"
45+
46+
allow_failures:
47+
# Dev-master is allowed to fail.
48+
- env: STABILITY="dev"
49+
50+
before_install:
51+
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
52+
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
53+
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
3054

3155
install:
32-
- travis_retry composer update --prefer-dist --no-interaction
56+
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
57+
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
58+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
59+
- vendor/bin/simple-phpunit install
3360

3461
script:
62+
- composer validate --strict --no-check-lock
3563
- $TEST_COMMAND
3664

3765
after_success:

composer.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"php": "^5.4 || ^7.0"
1313
},
1414
"require-dev": {
15-
"phpunit/phpunit": "^4.8.36 || ^5.5 || ^6.2"
15+
"symfony/phpunit-bridge": "^3.4 || ^4.0"
1616
},
1717
"autoload": {
1818
"psr-4": {
@@ -25,8 +25,7 @@
2525
}
2626
},
2727
"scripts": {
28-
"test": "vendor/bin/phpunit",
29-
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
28+
"test": "vendor/bin/simple-phpunit",
29+
"test-ci": "vendor/bin/simple-phpunit --coverage-text --coverage-clover=build/coverage.xml"
3030
}
3131
}
32-

0 commit comments

Comments
 (0)