|
|
|
#
|
|
|
|
# Travis Setup
|
|
|
|
#
|
|
|
|
|
|
|
|
# use ubuntu trusty for newer version of nodejs, used for JS testing
|
|
|
|
dist: trusty
|
|
|
|
|
|
|
|
# faster builds on new travis setup not using sudo
|
|
|
|
sudo: false
|
|
|
|
|
|
|
|
# build only on master branches
|
|
|
|
# commented as this prevents people from running builds on their forks:
|
|
|
|
# https://github.com/yiisoft/yii2/commit/bd87be990fa238c6d5e326d0a171f38d02dc253a
|
|
|
|
#branches:
|
|
|
|
# only:
|
|
|
|
# - master
|
|
|
|
# - 2.1
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Test Matrix
|
|
|
|
#
|
|
|
|
|
|
|
|
language: php
|
|
|
|
|
|
|
|
php:
|
|
|
|
- 5.4
|
|
|
|
- 5.5
|
|
|
|
- 5.6
|
|
|
|
- 7.0
|
|
|
|
- 7.1
|
|
|
|
- nightly
|
|
|
|
|
|
|
|
matrix:
|
|
|
|
fast_finish: true
|
|
|
|
include:
|
|
|
|
# Test against HHVM 3.12 LTS version by using trusty
|
|
|
|
- php: hhvm-3.12
|
|
|
|
sudo: true
|
|
|
|
dist: trusty
|
|
|
|
group: edge # Use edge image until the next travis CI image update
|
|
|
|
addons:
|
|
|
|
code_climate:
|
|
|
|
repo_token: 2935307212620b0e2228ab67eadd92c9f5501ddb60549d0d86007a354d56915b
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- mysql-server-5.6
|
|
|
|
- mysql-client-core-5.6
|
|
|
|
- mysql-client-5.6
|
|
|
|
services:
|
|
|
|
- mysql
|
|
|
|
# test against the latest HHVM version by using a newer image
|
|
|
|
- php: hhvm
|
|
|
|
sudo: true
|
|
|
|
dist: trusty
|
|
|
|
group: edge # Use edge image until the next travis CI image update
|
|
|
|
addons:
|
|
|
|
code_climate:
|
|
|
|
repo_token: 2935307212620b0e2228ab67eadd92c9f5501ddb60549d0d86007a354d56915b
|
|
|
|
postgresql: "9.3"
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- mysql-server-5.6
|
|
|
|
- mysql-client-core-5.6
|
|
|
|
- mysql-client-5.6
|
|
|
|
services:
|
|
|
|
- mysql
|
|
|
|
- postgresql
|
|
|
|
# have a separate branch for javascript tests
|
|
|
|
- language: node_js
|
|
|
|
node_js: 6
|
|
|
|
dist: trusty
|
|
|
|
# overwrite php related settings
|
|
|
|
php:
|
|
|
|
services:
|
|
|
|
addons:
|
|
|
|
install:
|
|
|
|
- travis_retry npm install
|
|
|
|
# disable xdebug for performance in composer
|
|
|
|
- phpenv config-rm xdebug.ini || echo "xdebug is not installed"
|
|
|
|
- travis_retry composer self-update && composer --version
|
|
|
|
- travis_retry composer global require "fxp/composer-asset-plugin:^1.2.0" --no-plugins
|
|
|
|
- travis_retry composer install --prefer-dist --no-interaction
|
|
|
|
before_script:
|
|
|
|
- node --version
|
|
|
|
- npm --version
|
|
|
|
- php --version
|
|
|
|
- composer --version
|
|
|
|
script: npm test
|
|
|
|
after_script:
|
|
|
|
|
|
|
|
allow_failures:
|
|
|
|
- php: nightly
|
|
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
- memcached
|
|
|
|
- mysql
|
|
|
|
- postgresql
|
|
|
|
|
|
|
|
# cache vendor dirs
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- vendor
|
|
|
|
- $HOME/.composer/cache
|
|
|
|
- $HOME/.npm
|
|
|
|
|
|
|
|
# try running against postgres 9.3
|
|
|
|
addons:
|
|
|
|
postgresql: "9.3"
|
|
|
|
code_climate:
|
|
|
|
repo_token: 2935307212620b0e2228ab67eadd92c9f5501ddb60549d0d86007a354d56915b
|
|
|
|
|
|
|
|
install:
|
|
|
|
- |
|
|
|
|
if [[ $TRAVIS_PHP_VERSION != '5.6' && $TRAVIS_PHP_VERSION != hhv* ]]; then
|
|
|
|
# disable xdebug for performance reasons when code coverage is not needed. note: xdebug on hhvm is disabled by default
|
|
|
|
phpenv config-rm xdebug.ini || echo "xdebug is not installed"
|
|
|
|
fi
|
|
|
|
- travis_retry composer self-update && composer --version
|
|
|
|
- travis_retry composer global require "fxp/composer-asset-plugin:^1.2.0" --no-plugins
|
|
|
|
- export PATH="$HOME/.composer/vendor/bin:$PATH"
|
|
|
|
# core framework:
|
|
|
|
- travis_retry composer install --prefer-dist --no-interaction
|
|
|
|
- tests/data/travis/apc-setup.sh
|
|
|
|
- tests/data/travis/memcache-setup.sh
|
|
|
|
- tests/data/travis/imagick-setup.sh
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
# Disable the HHVM JIT for faster Unit Testing
|
|
|
|
- if [[ $TRAVIS_PHP_VERSION = hhv* ]]; then echo 'hhvm.jit = 0' >> /etc/hhvm/php.ini; fi
|
|
|
|
# show some versions and env information
|
|
|
|
- php -r "echo INTL_ICU_VERSION . \"\n\";"
|
|
|
|
- php -r "echo INTL_ICU_DATA_VERSION . \"\n\";"
|
|
|
|
- mysql --version
|
|
|
|
- psql --version
|
|
|
|
|
|
|
|
# initialize databases
|
|
|
|
- travis_retry mysql -e 'CREATE DATABASE `yiitest`;';
|
|
|
|
- mysql -e "CREATE USER 'travis'@'localhost' IDENTIFIED WITH mysql_native_password;";
|
|
|
|
- mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'travis'@'localhost' WITH GRANT OPTION;";
|
|
|
|
- psql -U postgres -c 'CREATE DATABASE yiitest;';
|
|
|
|
|
|
|
|
# enable code coverage on PHP 5.6, only one PHP version needs to generate coverage data
|
|
|
|
- |
|
|
|
|
if [ $TRAVIS_PHP_VERSION = '5.6' ]; then
|
|
|
|
PHPUNIT_FLAGS="--coverage-clover=coverage.clover"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
script:
|
|
|
|
# ensure no files contain UTF-8 byte order mark
|
|
|
|
- if ! grep -rlI $'\xEF\xBB\xBF' framework/ ; then echo "no utf8 BOM found"; else echo "found utf8 BOM in some files. See above."; exit 1; fi
|
|
|
|
# validate composer.json
|
|
|
|
- composer validate --no-check-lock
|
|
|
|
- cd framework && composer validate --no-check-lock && cd ..
|
|
|
|
# run PHPUnit
|
|
|
|
- vendor/bin/phpunit --verbose $PHPUNIT_FLAGS --exclude-group mssql,oci,wincache,xcache,zenddata,cubrid
|
|
|
|
|
|
|
|
after_script:
|
|
|
|
- |
|
|
|
|
if [ $TRAVIS_PHP_VERSION = '5.6' ]; then
|
|
|
|
travis_retry wget https://scrutinizer-ci.com/ocular.phar
|
|
|
|
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
|
|
|
|
fi
|