2011-11-10 03:27:56 +00:00
|
|
|
language: php
|
|
|
|
|
2015-05-12 10:50:02 +01:00
|
|
|
sudo: false
|
|
|
|
|
|
|
|
addons:
|
2015-08-18 15:04:52 +01:00
|
|
|
apt_packages:
|
|
|
|
- parallel
|
|
|
|
- language-pack-fr-base
|
2015-05-12 10:50:02 +01:00
|
|
|
|
2015-12-11 18:21:41 +00:00
|
|
|
env:
|
|
|
|
global:
|
2015-12-18 15:35:58 +00:00
|
|
|
- MIN_PHP=5.3.9
|
2015-10-13 09:49:36 +01:00
|
|
|
|
2013-12-14 12:00:39 +00:00
|
|
|
matrix:
|
2014-07-06 15:36:42 +01:00
|
|
|
include:
|
2015-07-02 07:16:05 +01:00
|
|
|
- php: hhvm
|
2014-12-26 09:21:27 +00:00
|
|
|
- php: 5.3
|
|
|
|
- php: 5.4
|
|
|
|
- php: 5.5
|
|
|
|
- php: 5.6
|
2015-08-11 12:18:28 +01:00
|
|
|
env: deps=high
|
2015-12-11 18:21:41 +00:00
|
|
|
- php: 7.0
|
2015-09-03 12:24:41 +01:00
|
|
|
env: deps=low
|
2014-12-26 09:21:27 +00:00
|
|
|
fast_finish: true
|
2013-01-04 08:48:20 +00:00
|
|
|
|
2015-12-11 18:21:41 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- .phpunit
|
|
|
|
- php-$MIN_PHP
|
2013-12-20 14:57:17 +00:00
|
|
|
|
2015-12-11 18:21:41 +00:00
|
|
|
services: mongodb
|
2014-07-06 15:36:42 +01:00
|
|
|
|
2014-09-02 15:17:55 +01:00
|
|
|
before_install:
|
2016-02-02 16:13:46 +00:00
|
|
|
# Matrix lines for intermediate PHP versions are skipped for pull requests
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ ! $deps && ! $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && $TRAVIS_PHP_VERSION != hhvm && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; fi;
|
2016-02-02 16:13:46 +00:00
|
|
|
# A sigchild-enabled-PHP is used to test the Process component on the lowest PHP matrix line
|
2015-12-30 16:55:43 +00:00
|
|
|
- if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && ! -d php-$MIN_PHP/sapi ]]; then wget http://museum.php.net/php5/php-$MIN_PHP.tar.bz2 -O - | tar -xj; (cd php-$MIN_PHP; ./configure --enable-sigchild --enable-pcntl; make -j2); fi;
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi;
|
|
|
|
- echo memory_limit = -1 >> $INI_FILE
|
|
|
|
- echo session.gc_probability = 0 >> $INI_FILE
|
|
|
|
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi;
|
|
|
|
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi;
|
2016-01-11 09:55:59 +00:00
|
|
|
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.10 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
|
|
|
|
- if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.2 && echo apc.enable_cli = 1 >> $INI_FILE); fi;
|
2015-12-18 15:35:58 +00:00
|
|
|
- if [[ $TRAVIS_PHP_VERSION = 5.* && ! $deps ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi;
|
2016-01-11 09:55:59 +00:00
|
|
|
- if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then pecl install -f memcached-2.1.0; fi;
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then echo extension = ldap.so >> $INI_FILE; fi;
|
|
|
|
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then phpenv config-rm xdebug.ini; fi;
|
2015-12-29 15:09:05 +00:00
|
|
|
- if [[ $TRAVIS_REPO_SLUG = symfony/symfony ]]; then cp .composer-auth.json ~/.composer/auth.json; fi;
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ $deps != skip ]]; then composer self-update; fi;
|
|
|
|
- if [[ $deps != skip ]]; then ./phpunit install; fi;
|
|
|
|
- export PHPUNIT=$(readlink -f ./phpunit)
|
2013-09-12 22:41:34 +01:00
|
|
|
|
2014-09-02 15:17:55 +01:00
|
|
|
install:
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ $deps != skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi;
|
2016-02-02 16:13:46 +00:00
|
|
|
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ $deps != skip && $deps ]]; then php .travis.php $TRAVIS_COMMIT_RANGE $TRAVIS_BRANCH $COMPONENTS; fi;
|
2016-02-02 16:13:46 +00:00
|
|
|
# For the master branch when deps=high, the version before master is checked out and tested with the locally patched components
|
2015-12-22 12:45:04 +00:00
|
|
|
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi;
|
2016-02-01 13:16:12 +00:00
|
|
|
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi;
|
2016-02-02 16:13:46 +00:00
|
|
|
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number than the next one
|
2015-12-22 12:45:04 +00:00
|
|
|
- if [[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]]; then LEGACY=,legacy; fi;
|
2015-12-18 15:35:58 +00:00
|
|
|
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev;
|
2015-12-29 15:09:05 +00:00
|
|
|
- if [[ ! $deps ]]; then composer update --prefer-dist; else export SYMFONY_DEPRECATIONS_HELPER=weak; fi;
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ $TRAVIS_PHP_VERSION != hhvm ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi;
|
2014-09-02 15:17:55 +01:00
|
|
|
|
2013-09-12 22:41:34 +01:00
|
|
|
script:
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ ! $deps ]]; then echo "$COMPONENTS" | parallel --gnu '$PHPUNIT --exclude-group tty,benchmark,intl-data {}'; fi;
|
|
|
|
- if [[ ! $deps ]]; then echo -e "\\nRunning tests requiring tty"; $PHPUNIT --group tty; fi;
|
2015-12-31 08:50:01 +00:00
|
|
|
- if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | xargs -I{} sh -c 'echo "\\nPHP --enable-sigchild enhanced={}" && ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/'; fi;
|
2015-12-29 15:09:05 +00:00
|
|
|
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist; $PHPUNIT --exclude-group tty,benchmark,intl-data'$LEGACY; fi;
|
|
|
|
- if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -j10% 'cd {}; composer update --prefer-dist --prefer-lowest --prefer-stable; $PHPUNIT --exclude-group tty,benchmark,intl-data'; fi;
|
2015-12-11 18:21:41 +00:00
|
|
|
- if [[ $deps = skip ]]; then echo This matrix line is skipped for pull requests.; fi;
|