2011-11-10 03:27:56 +00:00
|
|
|
language: php
|
|
|
|
|
2021-06-06 15:23:08 +01:00
|
|
|
dist: bionic
|
2015-05-12 10:50:02 +01:00
|
|
|
|
2016-02-22 16:04:21 +00:00
|
|
|
git:
|
2021-06-25 09:27:06 +01:00
|
|
|
depth: 1
|
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
|
2018-07-08 02:07:36 +01:00
|
|
|
- zookeeperd
|
|
|
|
- libzookeeper-mt-dev
|
2021-06-06 15:23:08 +01:00
|
|
|
- libsodium-dev
|
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:
|
2019-05-28 14:10:17 +01:00
|
|
|
- php: 7.2
|
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:
|
2020-04-12 10:36:17 +01:00
|
|
|
- .phpunit
|
2018-02-22 12:59:51 +00:00
|
|
|
- ~/php-ext
|
2013-12-20 14:57:17 +00:00
|
|
|
|
2014-09-02 15:17:55 +01:00
|
|
|
before_install:
|
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
|
2021-06-07 19:50:09 +01:00
|
|
|
sudo sed -i 's/127\.0\.1\.1 localhost/127.0.0.1 localhost/' /etc/hosts
|
2020-10-26 16:14:25 +00:00
|
|
|
cp .github/composer-config.json "$(composer config home)/config.json"
|
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 () {
|
2021-01-13 23:57:45 +00: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
|
2021-01-14 19:21:32 +00:00
|
|
|
echo $input | pecl -q install -f $ext_name &&
|
2018-02-04 09:26:21 +00:00
|
|
|
cp $ext_dir/$ext_so $ext_cache
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
export -f tpecl
|
|
|
|
|
2018-08-02 07:56:36 +01:00
|
|
|
- |
|
|
|
|
# php.ini configuration
|
|
|
|
for PHP in $TRAVIS_PHP_VERSION $php_extra; do
|
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
|
2020-05-30 19:30:09 +01:00
|
|
|
echo default_socket_timeout = 10 >> $INI
|
2018-08-02 07:56:36 +01:00
|
|
|
echo session.gc_probability = 0 >> $INI
|
|
|
|
echo opcache.enable_cli = 1 >> $INI
|
|
|
|
echo apc.enable_cli = 1 >> $INI
|
|
|
|
done
|
2020-12-03 00:55:58 +00:00
|
|
|
find ~/.phpenv -name xdebug.ini -delete
|
2018-08-02 07:56:36 +01:00
|
|
|
|
2021-06-06 15:23:08 +01:00
|
|
|
composer self-update
|
|
|
|
composer self-update --2
|
|
|
|
|
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
|
2021-06-06 15:23:08 +01:00
|
|
|
if [[ $PHP != 8.* ]]; then
|
2020-05-23 14:21:30 +01:00
|
|
|
tfold ext.zookeeper tpecl zookeeper-0.7.2 zookeeper.so $INI
|
2018-08-02 07:56:36 +01:00
|
|
|
fi
|
|
|
|
done
|
2013-09-12 22:41:34 +01:00
|
|
|
|
2014-09-02 15:17:55 +01:00
|
|
|
install:
|
2021-06-25 09:27:06 +01:00
|
|
|
- export COMPONENTS=$(find src/Symfony -mindepth 2 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' -printf '%h\n' | sort)
|
|
|
|
- export COMPOSER_ROOT_VERSION=$(grep ' VERSION = ' src/Symfony/Component/HttpKernel/Kernel.php | grep -P -o '[0-9]+\.[0-9]+').x-dev
|
|
|
|
- composer update --no-progress --ansi
|
|
|
|
- ./phpunit install
|
2014-09-02 15:17:55 +01:00
|
|
|
|
2013-09-12 22:41:34 +01:00
|
|
|
script:
|
2021-06-25 09:27:06 +01:00
|
|
|
- echo "$COMPONENTS" | parallel --gnu "tfold {} ./phpunit --exclude-group tty,benchmark,intl-data {}"
|
|
|
|
- tfold src/Symfony/Component/Console.tty ./phpunit src/Symfony/Component/Console --group tty
|
|
|
|
- tfold src/Symfony/Bridge/Twig.tty ./phpunit src/Symfony/Bridge/Twig --group tty
|