Skip to content

Commit

Permalink
Improve travis (#19)
Browse files Browse the repository at this point in the history
* Improve travis

* Require phpunit bridge
  • Loading branch information
Nyholm authored Dec 28, 2017
1 parent 3d16154 commit 6d6b78d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 18 deletions.
56 changes: 42 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,57 @@ branches:
- /^analysis-.*$/
- /^patch-.*$/

php:
- 5.4
- 5.5
- 5.6
- 7.0
- 7.1

env:
global:
- TEST_COMMAND="composer test"

matrix:
fast_finish: true
include:
- php: 5.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" COVERAGE=true TEST_COMMAND="composer test-ci"
- php: hhvm
dist: trusty
fast_finish: true
include:
# Test with lowest dependencies
- php: 7.1
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"
- php: 5.5
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak"

# Test the latest stable release
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
- php: 7.1
- php: 7.2
env: COVERAGE=true TEST_COMMAND="composer test-ci"

# Force some major versions of Symfony
- php: 7.2
env: DEPENDENCIES="dunglas/symfony-lock:^2"
- php: 7.2
env: DEPENDENCIES="dunglas/symfony-lock:^3"
- php: 7.2
env: DEPENDENCIES="dunglas/symfony-lock:^4"

# Latest commit to master
- php: 7.2
env: STABILITY="dev"

allow_failures:
# Dev-master is allowed to fail.
- env: STABILITY="dev"

before_install:
- if [[ $COVERAGE != true ]]; then phpenv config-rm xdebug.ini || true; fi
- if ! [ -z "$STABILITY" ]; then composer config minimum-stability ${STABILITY}; fi;
- if ! [ -z "$DEPENDENCIES" ]; then composer require --no-update ${DEPENDENCIES}; fi;

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

script:
- composer validate --strict --no-check-lock
- $TEST_COMMAND

after_success:
Expand Down
7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"php": "^5.4 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.5 || ^6.2"
"symfony/phpunit-bridge": "^3.4 || ^4.0"
},
"autoload": {
"psr-4": {
Expand All @@ -25,8 +25,7 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit",
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
"test": "vendor/bin/simple-phpunit",
"test-ci": "vendor/bin/simple-phpunit --coverage-text --coverage-clover=build/coverage.xml"
}
}

0 comments on commit 6d6b78d

Please sign in to comment.