2011-11-10 03:27:56 +00:00
|
|
|
language: php
|
|
|
|
|
2019-05-08 15:56:36 +01:00
|
|
|
dist: xenial
|
2015-05-12 10:50:02 +01:00
|
|
|
|
2016-02-22 16:04:21 +00:00
|
|
|
git:
|
2018-09-03 13:29:28 +01:00
|
|
|
depth: 2
|
2016-02-22 16:04:21 +00:00
|
|
|
|
2015-05-12 10:50:02 +01:00
|
|
|
addons:
|
2015-08-18 15:04:52 +01:00
|
|
|
apt_packages:
|
|
|
|
- parallel
|
|
|
|
- language-pack-fr-base
|
2016-01-28 13:54:41 +00:00
|
|
|
- ldap-utils
|
|
|
|
- slapd
|
2018-07-08 02:07:36 +01:00
|
|
|
- zookeeperd
|
|
|
|
- libzookeeper-mt-dev
|
2019-05-08 15:56:36 +01:00
|
|
|
- rabbitmq-server
|
2015-05-12 10:50:02 +01:00
|
|
|
|
2015-12-11 18:21:41 +00:00
|
|
|
env:
|
|
|
|
global:
|
2017-05-18 08:23:23 +01:00
|
|
|
- MIN_PHP=7.1.3
|
2017-10-11 13:06:43 +01:00
|
|
|
- SYMFONY_PROCESS_PHP_TEST_BINARY=~/.phpenv/shims/php
|
2018-03-13 16:34:51 +00:00
|
|
|
- MESSENGER_AMQP_DSN=amqp://localhost/%2f/messages
|
2019-04-06 16:41:24 +01:00
|
|
|
- MESSENGER_REDIS_DSN=redis://127.0.0.1:7001/messages
|
2019-08-10 19:54:30 +01:00
|
|
|
- SYMFONY_PHPUNIT_DISABLE_RESULT_CACHE=1
|
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:
|
2018-08-03 13:33:19 +01:00
|
|
|
- php: 7.1
|
2019-08-23 14:32:15 +01:00
|
|
|
env: php_extra="7.2 7.4snapshot"
|
2018-12-20 21:16:23 +00:00
|
|
|
- php: 7.3
|
2019-08-21 19:56:01 +01:00
|
|
|
env: deps=high
|
|
|
|
- php: 7.4snapshot
|
2015-08-27 08:55:57 +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
|
2018-02-22 12:59:51 +00:00
|
|
|
- ~/php-ext
|
2013-12-20 14:57:17 +00:00
|
|
|
|
2016-01-19 13:27:46 +00:00
|
|
|
services:
|
2016-12-15 17:37:16 +00:00
|
|
|
- memcached
|
2016-01-19 13:27:46 +00:00
|
|
|
- mongodb
|
|
|
|
- redis-server
|
2018-03-13 16:34:51 +00:00
|
|
|
- rabbitmq
|
2018-08-23 22:19:02 +01:00
|
|
|
- docker
|
2014-07-06 15:36:42 +01:00
|
|
|
|
2014-09-02 15:17:55 +01:00
|
|
|
before_install:
|
2018-12-20 21:16:23 +00:00
|
|
|
- |
|
|
|
|
# Enable Sury ppa
|
|
|
|
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6B05F25D762E3157
|
|
|
|
sudo add-apt-repository -y ppa:ondrej/php
|
2019-04-12 13:53:42 +01:00
|
|
|
sudo rm /etc/apt/sources.list.d/google-chrome.list
|
|
|
|
sudo rm /etc/apt/sources.list.d/mongodb-3.4.list
|
2018-12-20 21:16:23 +00:00
|
|
|
sudo apt update
|
2019-02-01 21:30:43 +00:00
|
|
|
sudo apt install -y librabbitmq-dev libsodium-dev
|
2018-12-20 21:16:23 +00:00
|
|
|
|
2018-08-23 22:19:02 +01:00
|
|
|
- |
|
|
|
|
# Start Redis cluster
|
2019-04-06 16:41:24 +01:00
|
|
|
docker pull grokzen/redis-cluster:5.0.4
|
|
|
|
docker run -d -p 7000:7000 -p 7001:7001 -p 7002:7002 -p 7003:7003 -p 7004:7004 -p 7005:7005 --name redis-cluster grokzen/redis-cluster:5.0.4
|
2018-08-23 22:19:02 +01:00
|
|
|
export REDIS_CLUSTER_HOSTS='localhost:7000 localhost:7001 localhost:7002 localhost:7003 localhost:7004 localhost:7005'
|
|
|
|
|
2017-04-18 16:01:04 +01:00
|
|
|
- |
|
|
|
|
# General configuration
|
2018-08-02 07:56:36 +01:00
|
|
|
set -e
|
2017-04-18 16:01:04 +01:00
|
|
|
stty cols 120
|
2017-04-19 21:17:50 +01:00
|
|
|
mkdir /tmp/slapd
|
2018-12-07 04:37:05 +00:00
|
|
|
if [ ! -e /tmp/slapd-modules ]; then
|
|
|
|
[ -d /usr/lib/openldap ] && ln -s /usr/lib/openldap /tmp/slapd-modules || ln -s /usr/lib/ldap /tmp/slapd-modules
|
|
|
|
fi
|
2017-04-19 21:17:50 +01:00
|
|
|
slapd -f src/Symfony/Component/Ldap/Tests/Fixtures/conf/slapd.conf -h ldap://localhost:3389 &
|
2017-04-18 16:01:04 +01:00
|
|
|
[ -d ~/.composer ] || mkdir ~/.composer
|
2019-09-20 17:57:15 +01:00
|
|
|
cp .github/composer-config.json ~/.composer/config.json
|
2017-04-18 16:01:04 +01:00
|
|
|
export PHPUNIT=$(readlink -f ./phpunit)
|
|
|
|
export PHPUNIT_X="$PHPUNIT --exclude-group tty,benchmark,intl-data"
|
|
|
|
export COMPOSER_UP='composer update --no-progress --no-suggest --ansi'
|
2019-08-27 08:25:30 +01:00
|
|
|
export COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
|
2018-08-02 07:56:36 +01:00
|
|
|
find ~/.phpenv -name xdebug.ini -delete
|
2017-04-18 16:01:04 +01:00
|
|
|
|
2018-08-02 07:56:36 +01:00
|
|
|
nanoseconds () {
|
2017-08-24 09:32:12 +01:00
|
|
|
local cmd="date"
|
|
|
|
local format="+%s%N"
|
|
|
|
local os=$(uname)
|
|
|
|
if hash gdate > /dev/null 2>&1; then
|
|
|
|
cmd="gdate"
|
|
|
|
elif [[ "$os" = Darwin ]]; then
|
|
|
|
format="+%s000000000"
|
|
|
|
fi
|
|
|
|
$cmd -u $format
|
|
|
|
}
|
|
|
|
export -f nanoseconds
|
|
|
|
|
2017-04-18 16:01:04 +01:00
|
|
|
# tfold is a helper to create folded reports
|
|
|
|
tfold () {
|
2019-09-20 17:57:15 +01:00
|
|
|
local title="🐘 $PHP $1 $FLIP"
|
2017-08-24 09:32:12 +01:00
|
|
|
local fold=$(echo $title | sed -r 's/[^-_A-Za-z0-9]+/./g')
|
2017-04-18 16:01:04 +01:00
|
|
|
shift
|
2017-08-24 09:32:12 +01:00
|
|
|
local id=$(printf %08x $(( RANDOM * RANDOM )))
|
|
|
|
local start=$(nanoseconds)
|
|
|
|
echo -e "travis_fold:start:$fold"
|
|
|
|
echo -e "travis_time:start:$id"
|
|
|
|
echo -e "\\e[1;34m$title\\e[0m"
|
|
|
|
|
|
|
|
bash -xc "$*" 2>&1
|
|
|
|
local ok=$?
|
|
|
|
local end=$(nanoseconds)
|
|
|
|
echo -e "\\ntravis_time:end:$id:start=$start,finish=$end,duration=$(($end-$start))"
|
|
|
|
(exit $ok) &&
|
2017-04-18 16:01:04 +01:00
|
|
|
echo -e "\\e[32mOK\\e[0m $title\\n\\ntravis_fold:end:$fold" ||
|
2017-08-24 09:32:12 +01:00
|
|
|
echo -e "\\e[41mKO\\e[0m $title\\n"
|
|
|
|
(exit $ok)
|
2017-04-18 16:01:04 +01:00
|
|
|
}
|
|
|
|
export -f tfold
|
|
|
|
|
2018-02-04 09:26:21 +00:00
|
|
|
# tpecl is a helper to compile and cache php extensions
|
|
|
|
tpecl () {
|
|
|
|
local ext_name=$1
|
|
|
|
local ext_so=$2
|
2018-02-22 12:51:03 +00:00
|
|
|
local INI=$3
|
2019-04-06 16:41:24 +01:00
|
|
|
local input=${4:-yes}
|
2018-02-04 09:26:21 +00:00
|
|
|
local ext_dir=$(php -r "echo ini_get('extension_dir');")
|
2018-02-22 12:59:51 +00:00
|
|
|
local ext_cache=~/php-ext/$(basename $ext_dir)/$ext_name
|
2018-02-04 09:26:21 +00:00
|
|
|
|
|
|
|
if [[ -e $ext_cache/$ext_so ]]; then
|
|
|
|
echo extension = $ext_cache/$ext_so >> $INI
|
|
|
|
else
|
2018-08-02 07:56:36 +01:00
|
|
|
rm ~/.pearrc /tmp/pear 2>/dev/null || true
|
2018-02-04 09:26:21 +00:00
|
|
|
mkdir -p $ext_cache
|
2019-04-06 16:41:24 +01:00
|
|
|
echo $input | pecl install -f $ext_name &&
|
2018-02-04 09:26:21 +00:00
|
|
|
cp $ext_dir/$ext_so $ext_cache
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
export -f tpecl
|
|
|
|
|
2017-04-18 16:01:04 +01:00
|
|
|
- |
|
|
|
|
# Install sigchild-enabled PHP to test the Process component on the lowest PHP matrix line
|
2018-08-03 13:33:19 +01:00
|
|
|
if [[ ! $deps && $TRAVIS_PHP_VERSION = ${MIN_PHP%.*} && ! -d php-$MIN_PHP/sapi ]]; then
|
2017-05-18 08:23:23 +01:00
|
|
|
wget http://php.net/get/php-$MIN_PHP.tar.bz2/from/this/mirror -O - | tar -xj &&
|
2017-04-18 16:01:04 +01:00
|
|
|
(cd php-$MIN_PHP && ./configure --enable-sigchild --enable-pcntl && make -j2)
|
|
|
|
fi
|
|
|
|
|
2018-08-02 07:56:36 +01:00
|
|
|
- |
|
|
|
|
# php.ini configuration
|
|
|
|
for PHP in $TRAVIS_PHP_VERSION $php_extra; do
|
2019-08-23 14:32:15 +01:00
|
|
|
phpenv global $PHP 2>/dev/null || (cd / && wget https://storage.googleapis.com/travis-ci-language-archives/php/binaries/ubuntu/16.04/x86_64/php-$PHP.tar.bz2 -O - | tar -xj)
|
2018-08-03 12:13:38 +01:00
|
|
|
INI=~/.phpenv/versions/$PHP/etc/conf.d/travis.ini
|
2018-08-02 07:56:36 +01:00
|
|
|
echo date.timezone = Europe/Paris >> $INI
|
|
|
|
echo memory_limit = -1 >> $INI
|
|
|
|
echo session.gc_probability = 0 >> $INI
|
|
|
|
echo opcache.enable_cli = 1 >> $INI
|
|
|
|
echo apc.enable_cli = 1 >> $INI
|
2019-02-01 11:54:57 +00:00
|
|
|
echo extension = memcached.so >> $INI
|
2018-08-02 07:56:36 +01:00
|
|
|
done
|
|
|
|
|
2017-04-18 16:01:04 +01:00
|
|
|
- |
|
|
|
|
# Install extra PHP extensions
|
2018-08-02 07:56:36 +01:00
|
|
|
for PHP in $TRAVIS_PHP_VERSION $php_extra; do
|
|
|
|
export PHP=$PHP
|
|
|
|
phpenv global $PHP
|
|
|
|
INI=~/.phpenv/versions/$PHP/etc/conf.d/travis.ini
|
2018-10-14 20:02:12 +01:00
|
|
|
if ! php --ri sodium > /dev/null; then
|
|
|
|
tfold ext.libsodium tpecl libsodium sodium.so $INI
|
2018-08-02 07:56:36 +01:00
|
|
|
fi
|
2018-02-05 15:46:42 +00:00
|
|
|
|
2019-07-31 18:04:19 +01:00
|
|
|
tfold ext.apcu tpecl apcu-5.1.17 apcu.so $INI
|
2018-12-06 11:52:00 +00:00
|
|
|
tfold ext.mongodb tpecl mongodb-1.6.0alpha1 mongodb.so $INI
|
2019-01-24 22:35:26 +00:00
|
|
|
tfold ext.igbinary tpecl igbinary-2.0.8 igbinary.so $INI
|
2019-03-08 08:45:35 +00:00
|
|
|
tfold ext.zookeeper tpecl zookeeper-0.7.1 zookeeper.so $INI
|
2019-02-01 21:30:43 +00:00
|
|
|
tfold ext.amqp tpecl amqp-1.9.4 amqp.so $INI
|
2019-04-06 16:41:24 +01:00
|
|
|
tfold ext.redis tpecl redis-4.3.0 redis.so $INI "no"
|
2018-08-02 07:56:36 +01:00
|
|
|
done
|
2019-04-06 16:41:24 +01:00
|
|
|
- |
|
|
|
|
# List all php extensions with versions
|
|
|
|
- php -r 'foreach (get_loaded_extensions() as $extension) echo $extension . " " . phpversion($extension) . PHP_EOL;'
|
2013-09-12 22:41:34 +01:00
|
|
|
|
2017-04-19 21:17:50 +01:00
|
|
|
- |
|
|
|
|
# Load fixtures
|
|
|
|
if [[ ! $skip ]]; then
|
|
|
|
ldapadd -h localhost:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/base.ldif &&
|
|
|
|
ldapadd -h localhost:3389 -D cn=admin,dc=symfony,dc=com -w symfony -f src/Symfony/Component/Ldap/Tests/Fixtures/data/fixtures.ldif
|
|
|
|
fi
|
2013-09-12 22:41:34 +01:00
|
|
|
|
2014-09-02 15:17:55 +01:00
|
|
|
install:
|
2019-08-02 15:07:32 +01:00
|
|
|
- |
|
|
|
|
# Install the phpunit-bridge from a PR if required
|
|
|
|
#
|
2019-08-04 09:28:30 +01:00
|
|
|
# To run a PR with a patched phpunit-bridge, first submit the patch for the
|
2019-08-02 15:07:32 +01:00
|
|
|
# phpunit-bridge as a separate PR against the next feature-branch then
|
|
|
|
# uncomment and update the following line with that PR number
|
|
|
|
#SYMFONY_PHPUNIT_BRIDGE_PR=32886
|
|
|
|
|
|
|
|
if [[ $SYMFONY_PHPUNIT_BRIDGE_PR ]]; then
|
2019-09-20 17:57:15 +01:00
|
|
|
git fetch --depth=2 origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head
|
2019-08-02 15:07:32 +01:00
|
|
|
git rm -rq src/Symfony/Bridge/PhpUnit
|
|
|
|
git checkout -q FETCH_HEAD -- src/Symfony/Bridge/PhpUnit
|
2019-09-23 14:04:01 +01:00
|
|
|
export SYMFONY_VERSION=$(cat src/Symfony/Bridge/PhpUnit/composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*')
|
2019-08-02 15:07:32 +01:00
|
|
|
sed -i 's/"symfony\/phpunit-bridge": ".*"/"symfony\/phpunit-bridge": "'$SYMFONY_VERSION'.x@dev"/' composer.json
|
2019-08-05 09:06:54 +01:00
|
|
|
rm -rf .phpunit
|
2019-08-02 15:07:32 +01:00
|
|
|
fi
|
|
|
|
|
2017-04-18 16:01:04 +01:00
|
|
|
- |
|
|
|
|
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
|
2019-10-15 08:35:54 +01:00
|
|
|
git config --global user.email ""
|
|
|
|
git config --global user.name "Symfony"
|
|
|
|
|
2017-04-18 16:01:04 +01:00
|
|
|
if [[ ! $deps ]]; then
|
2018-09-03 11:42:20 +01:00
|
|
|
php .github/build-packages.php HEAD^ src/Symfony/Bridge/PhpUnit src/Symfony/Contracts
|
2018-08-02 07:56:36 +01:00
|
|
|
else
|
2017-04-18 16:01:04 +01:00
|
|
|
export SYMFONY_DEPRECATIONS_HELPER=weak &&
|
|
|
|
cp composer.json composer.json.orig &&
|
|
|
|
echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json &&
|
2019-09-23 14:04:01 +01:00
|
|
|
php .github/build-packages.php HEAD^ $(find src/Symfony -mindepth 3 -type f -name composer.json -printf '%h\n' | sort) &&
|
2017-04-18 16:01:04 +01:00
|
|
|
mv composer.json composer.json.phpunit &&
|
|
|
|
mv composer.json.orig composer.json
|
|
|
|
fi
|
2019-08-02 15:07:32 +01:00
|
|
|
if [[ $SYMFONY_PHPUNIT_BRIDGE_PR ]]; then
|
|
|
|
git rm -fq -- src/Symfony/Bridge/PhpUnit/composer.json
|
|
|
|
git diff --staged -- src/Symfony/Bridge/PhpUnit/ | git apply -R --index
|
|
|
|
fi
|
2017-04-18 16:01:04 +01: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
|
2019-09-20 17:57:15 +01:00
|
|
|
export FLIP='🙃'
|
2019-09-23 14:04:01 +01:00
|
|
|
export SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//) &&
|
2019-09-20 17:57:15 +01:00
|
|
|
git fetch --depth=2 origin $SYMFONY_VERSION &&
|
2017-04-18 16:01:04 +01:00
|
|
|
git checkout -m FETCH_HEAD &&
|
2019-09-23 11:16:38 +01:00
|
|
|
export COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
|
2018-08-02 07:56:36 +01:00
|
|
|
else
|
2019-09-23 14:04:01 +01:00
|
|
|
export SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*')
|
2017-04-18 16:01:04 +01:00
|
|
|
fi
|
|
|
|
|
2019-04-12 15:59:22 +01:00
|
|
|
- |
|
|
|
|
# Skip the phpunit-bridge on not-master branches when $deps is empty
|
|
|
|
if [[ ! $deps && $TRAVIS_BRANCH != master ]]; then
|
2019-09-23 08:36:04 +01:00
|
|
|
export COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' -printf '%h\n' | sort)
|
2019-04-12 15:59:22 +01:00
|
|
|
fi
|
|
|
|
|
2018-08-14 10:06:16 +01:00
|
|
|
- |
|
|
|
|
# Install symfony/flex
|
|
|
|
if [[ $deps = low ]]; then
|
|
|
|
export SYMFONY_REQUIRE='>=2.3'
|
|
|
|
else
|
|
|
|
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
|
|
|
|
fi
|
2018-08-19 09:40:01 +01:00
|
|
|
composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
|
2018-08-14 10:06:16 +01:00
|
|
|
|
2017-04-18 16:01:04 +01:00
|
|
|
- |
|
2019-07-24 19:15:30 +01:00
|
|
|
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
|
2019-09-23 08:36:04 +01:00
|
|
|
[[ $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) ]] && export LEGACY=,legacy
|
2017-04-18 16:01:04 +01:00
|
|
|
|
|
|
|
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
|
2018-08-02 07:56:36 +01:00
|
|
|
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
|
2017-05-18 13:41:01 +01:00
|
|
|
|
2017-05-18 18:40:51 +01:00
|
|
|
- php -i
|
2017-04-18 16:01:04 +01:00
|
|
|
|
|
|
|
- |
|
|
|
|
run_tests () {
|
|
|
|
set -e
|
2018-08-02 07:56:36 +01:00
|
|
|
export PHP=$1
|
2019-08-23 14:32:15 +01:00
|
|
|
if [[ $PHP != 7.4* && $PHP != $TRAVIS_PHP_VERSION && $TRAVIS_PULL_REQUEST != false ]]; then
|
2019-09-20 17:57:15 +01:00
|
|
|
echo -e "\\n\\e[33;1mIntermediate PHP version $PHP is skipped for pull requests.\\e[0m"
|
2019-09-23 08:36:04 +01:00
|
|
|
return
|
2018-08-02 07:56:36 +01:00
|
|
|
fi
|
2018-08-03 12:13:38 +01:00
|
|
|
phpenv global $PHP
|
2019-09-20 17:57:15 +01:00
|
|
|
([[ $deps ]] && cd src/Symfony/Component/HttpFoundation; cp composer.json composer.bak; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb)
|
2018-08-02 07:56:36 +01:00
|
|
|
tfold 'composer update' $COMPOSER_UP
|
|
|
|
tfold 'phpunit install' ./phpunit install
|
|
|
|
if [[ $deps = high ]]; then
|
2019-09-20 22:40:00 +01:00
|
|
|
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && $COMPOSER_UP && $PHPUNIT_X$LEGACY'" || X=1
|
2019-09-20 17:57:15 +01:00
|
|
|
(cd src/Symfony/Component/HttpFoundation; mv composer.bak composer.json)
|
|
|
|
COMPONENTS=$(git diff --name-only src/ | grep composer.json || true)
|
|
|
|
|
|
|
|
if [[ $COMPONENTS && $LEGACY && $TRAVIS_PULL_REQUEST != false ]]; then
|
2019-09-20 22:40:00 +01:00
|
|
|
export FLIP='🙃'
|
2019-09-20 17:57:15 +01:00
|
|
|
SYMFONY_VERSION=$(echo $SYMFONY_VERSION | awk '{print $1 - 1}')
|
2019-09-21 08:43:36 +01:00
|
|
|
echo -e "\\n\\e[33;1mChecking out Symfony $SYMFONY_VERSION and running tests with patched components as deps\\e[0m"
|
2019-09-20 17:57:15 +01:00
|
|
|
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
|
|
|
|
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
|
|
|
|
git fetch --depth=2 origin $SYMFONY_VERSION
|
|
|
|
git checkout -m FETCH_HEAD
|
2019-09-21 08:43:36 +01:00
|
|
|
COMPONENTS=$(echo "$COMPONENTS" | xargs dirname | xargs -n1 -I{} bash -c "[ -e '{}/phpunit.xml.dist' ] && echo '{}'" | sort)
|
2019-09-20 17:57:15 +01:00
|
|
|
(cd src/Symfony/Component/HttpFoundation; composer config platform.ext-mongodb 1.6.0; composer require --dev --no-update mongodb/mongodb)
|
2019-09-21 08:43:36 +01:00
|
|
|
[[ ! $COMPONENTS ]] || tfold 'phpunit install' SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 ./phpunit install
|
2019-09-23 14:10:50 +01:00
|
|
|
[[ ! $COMPONENTS ]] || echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && rm composer.lock vendor/ -Rf && $COMPOSER_UP && $PHPUNIT_X$LEGACY'" || X=1
|
2019-09-20 17:57:15 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
[[ ! $X ]] || (exit 1)
|
2017-04-18 16:01:04 +01:00
|
|
|
elif [[ $deps = low ]]; then
|
2018-08-06 21:01:26 +01:00
|
|
|
[[ -e ~/php-ext/composer-lowest.lock.tar ]] && tar -xf ~/php-ext/composer-lowest.lock.tar
|
|
|
|
tar -cf ~/php-ext/composer-lowest.lock.tar --files-from /dev/null
|
|
|
|
php .github/rm-invalid-lowest-lock-files.php $COMPONENTS
|
2019-09-20 17:57:15 +01:00
|
|
|
echo "$COMPONENTS" | parallel --gnu "tfold {} 'cd {} && ([ -e composer.lock ] && ${COMPOSER_UP/update/install} || $COMPOSER_UP --prefer-lowest --prefer-stable) && $PHPUNIT_X'"
|
2018-08-06 21:01:26 +01:00
|
|
|
echo "$COMPONENTS" | xargs -n1 -I{} tar --append -f ~/php-ext/composer-lowest.lock.tar {}/composer.lock
|
2017-04-18 16:01:04 +01:00
|
|
|
else
|
2019-08-23 14:32:15 +01:00
|
|
|
if [[ $PHP = 7.4* ]]; then
|
|
|
|
# add return types before running the test suite
|
|
|
|
rm vendor/symfony/contracts -Rf
|
|
|
|
ln -sd $(realpath src/Symfony/Contracts) vendor/symfony/contracts
|
|
|
|
sed -i 's/"\*\*\/Tests\/"//' composer.json
|
|
|
|
composer install --optimize-autoloader
|
2019-09-25 19:58:06 +01:00
|
|
|
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php
|
|
|
|
SYMFONY_PATCH_TYPE_DECLARATIONS=force=object php .github/patch-types.php # ensure the script is idempotent
|
2019-09-23 14:10:50 +01:00
|
|
|
PHPUNIT_X="$PHPUNIT_X,legacy"
|
2019-08-23 14:32:15 +01:00
|
|
|
fi
|
|
|
|
|
2017-04-18 16:01:04 +01:00
|
|
|
echo "$COMPONENTS" | parallel --gnu "tfold {} $PHPUNIT_X {}"
|
2019-09-06 12:06:38 +01:00
|
|
|
tfold src/Symfony/Component/Console.tty $PHPUNIT --group tty
|
2018-08-03 13:33:19 +01:00
|
|
|
if [[ $PHP = ${MIN_PHP%.*} ]]; then
|
|
|
|
export PHP=$MIN_PHP
|
2017-07-04 12:07:48 +01:00
|
|
|
tfold src/Symfony/Component/Process.sigchild SYMFONY_DEPRECATIONS_HELPER=weak php-$MIN_PHP/sapi/cli/php ./phpunit --colors=always src/Symfony/Component/Process/
|
2017-04-18 16:01:04 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
2019-09-23 08:36:04 +01:00
|
|
|
export -f run_tests
|
2014-09-02 15:17:55 +01:00
|
|
|
|
2013-09-12 22:41:34 +01:00
|
|
|
script:
|
2019-09-23 08:36:04 +01:00
|
|
|
echo $TRAVIS_PHP_VERSION $php_extra | xargs -n1 bash -c '(</dev/tty run_tests $0)' || false
|