This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/.travis.yml

95 lines
6.3 KiB
YAML
Raw Normal View History

2011-11-10 03:27:56 +00:00
language: php
sudo: false
git:
depth: 1
addons:
2015-08-18 15:04:52 +01:00
apt_packages:
- parallel
- language-pack-fr-base
env:
global:
- MIN_PHP=5.3.9
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/versions/5.6/bin/php
2015-10-13 09:49:36 +01:00
2013-12-14 12:00:39 +00:00
matrix:
include:
# Use the newer stack for HHVM as HHVM does not support Precise anymore since a long time and so Precise has an outdated version
2017-03-08 09:04:21 +00:00
- php: hhvm-3.18
sudo: required
dist: trusty
group: edge
- php: 5.3
- php: 5.4
- php: 5.5
- php: 5.6
- php: 7.0
2016-07-19 07:52:31 +01:00
env: deps=high
2016-09-01 16:15:52 +01:00
- php: 7.1
env: deps=low
fast_finish: true
cache:
directories:
- .phpunit
- php-$MIN_PHP
services: mongodb
before_install:
2016-06-03 09:10:46 +01:00
- stty cols 120
- PHP=$TRAVIS_PHP_VERSION
2016-02-02 16:13:46 +00:00
# Matrix lines for intermediate PHP versions are skipped for pull requests
- if [[ ! $deps && ! $PHP = ${MIN_PHP%.*} && ! $PHP = hhvm* && $TRAVIS_PULL_REQUEST != false ]]; then deps=skip; skip=1; 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
- if [[ ! $deps && $PHP = ${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
- if [[ ! $PHP = hhvm* ]]; then INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini; else INI_FILE=/etc/hhvm/php.ini; fi
2016-11-17 15:59:01 +00:00
- if [[ ! $skip ]]; then echo date.timezone = Europe/Paris >> $INI_FILE; fi
- if [[ ! $skip ]]; then echo memory_limit = -1 >> $INI_FILE; fi
- if [[ ! $skip ]]; then echo session.gc_probability = 0 >> $INI_FILE; fi
- if [[ ! $skip ]]; then echo opcache.enable_cli = 1 >> $INI_FILE; fi
- if [[ ! $skip ]]; then echo hhvm.jit = 0 >> $INI_FILE; fi
- if [[ ! $skip && $PHP = 5.* ]]; then echo extension = mongo.so >> $INI_FILE; fi
- if [[ ! $skip && $PHP = 5.* ]]; then echo extension = memcache.so >> $INI_FILE; fi
2016-07-19 07:52:31 +01:00
- if [[ ! $skip && $PHP = 5.* ]]; then (echo yes | pecl install -f apcu-4.0.11 && echo apc.enable_cli = 1 >> $INI_FILE); fi
2016-09-01 16:15:52 +01:00
- if [[ ! $skip && $PHP = 7.* ]]; then (echo yes | pecl install -f apcu-5.1.6 && echo apc.enable_cli = 1 >> $INI_FILE); fi
- if [[ ! $deps && $PHP = 5.* ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo extension = $(pwd)/modules/symfony_debug.so >> $INI_FILE); fi
- if [[ ! $skip && $PHP = 5.* ]]; then pecl install -f memcached-2.1.0; fi
- if [[ ! $skip && ! $PHP = hhvm* ]]; then echo extension = ldap.so >> $INI_FILE; fi
2016-07-19 07:52:31 +01:00
- if [[ ! $skip && ! $PHP = hhvm* ]]; then phpenv config-rm xdebug.ini || echo "xdebug not available"; fi
2016-08-10 07:41:52 +01:00
- if [[ ! $skip ]]; then [ -d ~/.composer ] || mkdir ~/.composer; cp .composer/* ~/.composer/; fi
- if [[ ! $skip ]]; then export PHPUNIT=$(readlink -f ./phpunit); fi
2013-09-12 22:41:34 +01:00
install:
2016-09-12 11:06:58 +01:00
- if [[ ! $skip && $deps ]]; then cp composer.json composer.json.orig; fi
- if [[ ! $skip && $deps ]]; then echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json; fi
- if [[ ! $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
2016-09-13 12:35:02 +01:00
- if [[ ! $skip && $deps ]]; then php .github/build-packages.php HEAD^ $COMPONENTS; fi
2016-09-12 11:06:58 +01:00
- if [[ ! $skip && $deps ]]; then mv composer.json composer.json.phpunit; mv composer.json.orig composer.json; fi
2016-09-13 12:35:02 +01:00
- if [[ ! $skip && ! $deps ]]; then php .github/build-packages.php HEAD^ src/Symfony/Bridge/PhpUnit; 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
- 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-09-12 11:06:58 +01: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
- 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
- export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
2016-09-12 11:06:58 +01:00
- if [[ ! $skip && $deps ]]; then export SYMFONY_DEPRECATIONS_HELPER=weak; fi
- if [[ ! $skip && $deps ]]; then mv composer.json.phpunit composer.json; fi
- if [[ ! $skip ]]; then composer update --no-suggest; fi
2017-01-03 07:41:06 +00:00
- if [[ ! $skip ]]; then ./phpunit install; fi
2016-09-12 11:06:58 +01:00
- if [[ ! $skip && ! $PHP = hhvm* ]]; then php -i; else hhvm --php -r 'print_r($_SERVER);print_r(ini_get_all());'; fi
2017-04-03 12:58:31 +01:00
- . .github/travis_fold.sh
2013-09-12 22:41:34 +01:00
script:
- if [[ $skip ]]; then echo -e "\\n\\e[1;34mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"; fi
2017-04-03 12:58:31 +01:00
- if [[ ! $deps && ! $PHP = hhvm* ]]; then echo "$COMPONENTS" | parallel --gnu -k 'tfold {}.PHPUnit "$PHPUNIT --exclude-group tty,benchmark,intl-data {}"'; fi
- if [[ ! $deps && ! $PHP = hhvm* ]]; then tfold PHPUnit.tty "$PHPUNIT --group tty"; fi
2017-01-03 16:38:07 +00:00
- if [[ ! $deps && $PHP = hhvm* ]]; then $PHPUNIT --exclude-group benchmark,intl-data; fi
2017-04-03 12:58:31 +01:00
- if [[ ! $deps && $PHP = ${MIN_PHP%.*} ]]; then echo -e "1\\n0" | xargs -I{} sh -c 'tfold PHPUnit.sigchild "ENHANCE_SIGCHLD={} php-$MIN_PHP/sapi/cli/php .phpunit/phpunit-4.8/phpunit --colors=always src/Symfony/Component/Process/"'; fi
- if [[ $deps = high ]]; then echo "$COMPONENTS" | parallel --gnu -k -j10% 'cd {}; tfold {}.composer "composer update --no-progress --no-suggest --ansi 2>&1"; tfold {}.PHPUnit "$PHPUNIT --exclude-group tty,benchmark,intl-data$LEGACY"'; fi
- if [[ $deps = low ]]; then echo "$COMPONENTS" | parallel --gnu -k -j10% 'cd {}; tfold {}.composer "composer update --no-progress --no-suggest --ansi --prefer-lowest --prefer-stable 2>&1"; tfold {}.PHPUnit "$PHPUNIT --exclude-group tty,benchmark,intl-data"'; fi