Skip to content

Commit 3053d61

Browse files
authored
Improved travis config to test on sf4 (#161)
* Added travis config * Bugfix * minor * Temporary allow deprecations * Added property access in sf 2 * Better versions of matthias nobacks tests * Using phpunit 5.7
1 parent e6b000b commit 3053d61

File tree

2 files changed

+55
-31
lines changed

2 files changed

+55
-31
lines changed

.travis.yml

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,68 @@ branches:
99
- /^analysis-.*$/
1010
- /^patch-.*$/
1111

12-
php:
13-
- 5.5
14-
- 5.6
15-
- 7.0
16-
- 7.1
17-
- 7.2
18-
1912
env:
2013
global:
2114
- TEST_COMMAND="composer test"
15+
- SYMFONY_PHPUNIT_VERSION="6.3"
16+
- SYMFONY_DEPRECATIONS_HELPER="weak" # Temporary, To be removed
2217

2318
matrix:
24-
fast_finish: true
25-
include:
26-
- php: 5.5
27-
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
28-
- php: 7.1
29-
env: DEPENDENCIES=dev
30-
# Test against LTS versions
31-
- php: 7.0
32-
env: SYMFONY_VERSION=2.7.*
33-
- php: 7.0
34-
env: SYMFONY_VERSION=2.8.* PACKAGES=twig/twig:^1.34
35-
- php: 7.0
36-
env: SYMFONY_VERSION=2.8.*
19+
fast_finish: true
20+
include:
21+
# Test with lowest dependencies
22+
- php: 7.1
23+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7"
24+
- php: 5.5
25+
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak" SYMFONY_PHPUNIT_VERSION="5.7"
26+
27+
# Test the latest stable release
28+
- php: 5.5
29+
env: SYMFONY_PHPUNIT_VERSION="5.7"
30+
- php: 5.6
31+
env: SYMFONY_PHPUNIT_VERSION="5.7"
32+
- php: 7.0
33+
- php: 7.1
34+
- php: 7.2
35+
env: COVERAGE=true TEST_COMMAND="composer test-ci"
36+
37+
# Force some major versions of Symfony
38+
- php: 7.2
39+
env: DEPENDENCIES="dunglas/symfony-lock:^2 symfony/property-access:^2.8"
40+
- php: 7.2
41+
env: DEPENDENCIES="dunglas/symfony-lock:^3"
42+
- php: 7.2
43+
env: DEPENDENCIES="dunglas/symfony-lock:^4"
44+
- php: 7.0
45+
env: DEPENDENCIES="dunglas/symfony-lock:^2 twig/twig:^1.34 symfony/property-access:^2.8"
46+
47+
# Latest commit to master
48+
- php: 7.2
49+
env: STABILITY="dev"
50+
51+
allow_failures:
52+
# Dev-master is allowed to fail.
53+
- env: STABILITY="dev"
3754

3855
before_install:
39-
- if [ "$SYMFONY_VERSION" != "" ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" --no-update; fi;
40-
- if [ "$PACKAGES" != "" ]; then composer require $PACKAGES --no-update; fi;
41-
- if [ "$DEPENDENCIES" = "dev" ]; then perl -pi -e 's/^}$/,"minimum-stability":"dev"}/' composer.json; fi;
56+
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
57+
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
58+
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;
4259

4360
install:
44-
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
61+
# To be removed when this issue will be resolved: https://github.com/composer/composer/issues/5355
62+
- if [[ "$COMPOSER_FLAGS" == *"--prefer-lowest"* ]]; then composer update --prefer-dist --no-interaction --prefer-stable --quiet; fi
63+
- composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction
64+
- vendor/bin/simple-phpunit install
4565

4666
script:
67+
- composer validate --strict --no-check-lock
4768
- $TEST_COMMAND
4869

4970
after_success:
5071
- if [[ $COVERAGE = true ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
5172
- if [[ $COVERAGE = true ]]; then php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml; fi
73+
74+
after_script:
75+
- wget http://tnyholm.se/reporter.phar
76+
- php reporter.phar build:upload

composer.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"php-translation/extractor": "^1.2"
2323
},
2424
"require-dev": {
25-
"phpunit/phpunit": "^4.8.36 || ^5.5 || ^6.2",
25+
"symfony/phpunit-bridge": "^3.4 || ^4.0",
2626
"php-translation/translator": "^0.1",
2727
"php-http/curl-client": "^1.7",
2828
"php-http/message": "^1.6",
@@ -34,10 +34,11 @@
3434
"symfony/templating": "^2.7 || ^3.0 || ^4.0",
3535
"symfony/dependency-injection": "^2.7 || ^3.0 || ^4.0",
3636
"symfony/web-profiler-bundle": "^2.7 || ^3.0 || ^4.0",
37-
"matthiasnoback/symfony-dependency-injection-test": "^1.0 || ^2.0",
37+
"matthiasnoback/symfony-dependency-injection-test": "^1.2 || ^2.3",
38+
"matthiasnoback/symfony-config-test": "^2.2 || ^3.1",
3839
"guzzlehttp/psr7": "^1.4",
3940
"nyholm/nsa": "^1.1",
40-
"nyholm/symfony-bundle-test": "^1.2"
41+
"nyholm/symfony-bundle-test": "^1.2.3"
4142
},
4243
"suggest": {
4344
"php-http/httplug-bundle": "To easier configure your httplug clients."
@@ -46,11 +47,9 @@
4647
"psr-4": { "Translation\\Bundle\\": "" }
4748
},
4849
"scripts": {
49-
"test": "vendor/bin/phpunit",
50-
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
50+
"test": "vendor/bin/simple-phpunit",
51+
"test-ci": "vendor/bin/simple-phpunit --coverage-text --coverage-clover=build/coverage.xml"
5152
},
52-
"minimum-stability": "dev",
53-
"prefer-stable": true,
5453
"extra": {
5554
"branch-alias": {
5655
"dev-master": "0.4-dev"

0 commit comments

Comments
 (0)