2014-12-22 23:25:40 +00:00
|
|
|
sudo: false
|
2013-12-02 19:41:26 +00:00
|
|
|
language: php
|
2017-03-11 17:18:14 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- node_modules
|
2017-04-24 00:44:13 +00:00
|
|
|
- vendor
|
|
|
|
- $HOME/.composer/cache
|
2014-06-21 20:05:19 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
2014-12-17 23:50:37 +00:00
|
|
|
- php: 5.5
|
|
|
|
env: WP_TRAVISCI=travis:js
|
|
|
|
- php: 5.6
|
|
|
|
env: WP_TRAVISCI=travis:phpunit
|
2017-04-15 17:50:27 +00:00
|
|
|
- php: 5.2
|
|
|
|
env: WP_TRAVISCI=travis:phpunit
|
2014-06-21 20:05:19 +00:00
|
|
|
fast_finish: true
|
|
|
|
before_install:
|
2014-12-17 23:50:37 +00:00
|
|
|
- WP_CORE_DIR=/tmp/wordpress/
|
|
|
|
- |
|
|
|
|
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
|
|
|
|
mysql -e "CREATE DATABASE wordpress_tests;" -uroot
|
|
|
|
cp wp-tests-config-sample.php wp-tests-config.php
|
|
|
|
sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
|
|
|
|
sed -i "s/yourusernamehere/travis/" wp-tests-config.php
|
|
|
|
sed -i "s/yourpasswordhere//" wp-tests-config.php
|
|
|
|
svn checkout https://plugins.svn.wordpress.org/wordpress-importer/trunk tests/phpunit/data/plugins/wordpress-importer
|
|
|
|
fi
|
2013-12-02 19:41:26 +00:00
|
|
|
before_script:
|
2017-03-07 01:10:46 +00:00
|
|
|
- |
|
2017-03-11 02:43:29 +00:00
|
|
|
# Remove Xdebug for a huge performance increase, but not from nightly or hhvm:
|
|
|
|
stable='^[0-9\.]+$'
|
2017-03-07 01:10:46 +00:00
|
|
|
if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
|
2017-03-11 02:43:29 +00:00
|
|
|
phpenv config-rm xdebug.ini
|
2017-03-07 01:10:46 +00:00
|
|
|
fi
|
2017-03-11 02:43:29 +00:00
|
|
|
- |
|
|
|
|
# Export Composer's global bin dir to PATH, but not on PHP 5.2:
|
|
|
|
if [[ ${TRAVIS_PHP_VERSION:0:3} != "5.2" ]]; then
|
|
|
|
composer config --list --global
|
|
|
|
export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
|
|
|
|
fi
|
|
|
|
- |
|
|
|
|
# Install the specified version of PHPUnit depending on the PHP version:
|
|
|
|
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
|
|
|
|
case "$TRAVIS_PHP_VERSION" in
|
|
|
|
7.1|7.0|hhvm|nightly)
|
|
|
|
echo "Using PHPUnit 5.7"
|
|
|
|
composer global require "phpunit/phpunit=5.7.*"
|
|
|
|
;;
|
|
|
|
5.6|5.5|5.4|5.3)
|
|
|
|
echo "Using PHPUnit 4.8"
|
|
|
|
composer global require "phpunit/phpunit=4.8.*"
|
|
|
|
;;
|
|
|
|
5.2)
|
|
|
|
# Do nothing, use default PHPUnit 3.6.x
|
|
|
|
echo "Using default PHPUnit, hopefully 3.6"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "No PHPUnit version handling for PHP version $TRAVIS_PHP_VERSION"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
- npm --version
|
|
|
|
- node --version
|
|
|
|
- nvm install 4.7.2
|
2014-12-17 23:50:37 +00:00
|
|
|
- npm install -g grunt-cli
|
|
|
|
- npm install
|
2017-03-11 17:18:14 +00:00
|
|
|
- npm prune
|
2017-03-07 01:10:46 +00:00
|
|
|
- php --version
|
2017-03-11 02:43:29 +00:00
|
|
|
- |
|
|
|
|
# Debug PHP extensions, but not on HHVM because the command hangs indefinitely:
|
|
|
|
if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' ]]; then
|
|
|
|
php -m
|
|
|
|
fi
|
|
|
|
- npm --version
|
|
|
|
- node --version
|
|
|
|
- which phpunit
|
|
|
|
- phpunit --version
|
|
|
|
- curl --version
|
|
|
|
- grunt --version
|
|
|
|
- git --version
|
|
|
|
- svn --version
|
2014-06-21 20:05:19 +00:00
|
|
|
script: grunt $WP_TRAVISCI
|
2014-12-17 23:50:37 +00:00
|
|
|
notifications:
|
|
|
|
slack:
|
2017-03-11 02:43:29 +00:00
|
|
|
rooms:
|
|
|
|
secure: WuMCpfgrm0GIdPbYzsGOsakZ5x7QIbEBwD+CPHVXGKbL3ZbqQ+BVcDRnMiwzxjgf1vzg2de0taXCSMGKBxsWce23NZkOnmwPdIB8XOnwDV7T7zylgYD5S7p3gI6gV0l8Y3/gROdXFZap6viC1qRr4E79ow53RKk7E3WyOo7TWqo=
|
|
|
|
on_start: never
|
|
|
|
on_failure: always
|
|
|
|
on_success: change
|