2014-12-23 00:25:40 +01:00
|
|
|
sudo: false
|
2013-12-02 20:41:26 +01:00
|
|
|
language: php
|
2016-03-22 22:49:36 +01:00
|
|
|
cache:
|
2016-05-25 08:11:20 +02:00
|
|
|
apt: true
|
2016-03-22 22:49:36 +01:00
|
|
|
directories:
|
|
|
|
- node_modules
|
2016-05-25 08:11:20 +02:00
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- WP_TRAVISCI=travis:phpunit
|
2014-06-21 22:05:19 +02:00
|
|
|
matrix:
|
|
|
|
include:
|
2017-04-15 19:44:01 +02:00
|
|
|
- php: 7.1
|
2014-12-18 00:50:37 +01:00
|
|
|
env: WP_TRAVISCI=travis:js
|
2017-04-15 19:44:01 +02:00
|
|
|
- php: 7.1
|
|
|
|
- php: 7.0
|
2014-12-18 00:50:37 +01:00
|
|
|
- php: 5.6
|
2015-10-16 00:51:38 +02:00
|
|
|
- php: 5.6
|
2016-05-25 08:11:20 +02:00
|
|
|
env: WP_TRAVIS_OBJECT_CACHE=true
|
2015-10-16 00:51:38 +02:00
|
|
|
services: memcached
|
2017-04-15 19:44:01 +02:00
|
|
|
- php: 5.5
|
|
|
|
- php: 5.4
|
|
|
|
- php: 5.3
|
|
|
|
- php: 5.2
|
2014-12-18 00:50:37 +01:00
|
|
|
- php: hhvm
|
2016-05-25 08:11:20 +02:00
|
|
|
sudo: required
|
|
|
|
dist: trusty
|
|
|
|
group: edge
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- mysql-server-5.6
|
|
|
|
- mysql-client-core-5.6
|
|
|
|
- mysql-client-5.6
|
2015-10-02 18:50:53 +02:00
|
|
|
- php: nightly
|
2014-06-21 22:05:19 +02:00
|
|
|
allow_failures:
|
2014-12-18 00:50:37 +01:00
|
|
|
- php: hhvm
|
2015-10-02 18:50:53 +02:00
|
|
|
- php: nightly
|
2014-06-21 22:05:19 +02:00
|
|
|
before_install:
|
2014-12-18 00:50:37 +01:00
|
|
|
- |
|
|
|
|
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
|
2016-05-25 08:11:20 +02:00
|
|
|
mysql -u root -e "CREATE DATABASE wordpress_tests;"
|
2014-12-18 00:50:37 +01:00
|
|
|
cp wp-tests-config-sample.php wp-tests-config.php
|
|
|
|
sed -i "s/youremptytestdbnamehere/wordpress_tests/" wp-tests-config.php
|
2016-05-25 08:11:20 +02:00
|
|
|
sed -i "s/yourusernamehere/root/" wp-tests-config.php
|
2014-12-18 00:50:37 +01:00
|
|
|
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
|
2015-10-16 00:51:38 +02:00
|
|
|
- |
|
|
|
|
if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then
|
2015-10-16 16:15:18 +02:00
|
|
|
curl https://raw.githubusercontent.com/tollmanz/wordpress-pecl-memcached-object-cache/584392b56dc4adbe52bd2c7b86f875e23a3e5f75/object-cache.php > src/wp-content/object-cache.php
|
2015-10-16 00:51:38 +02:00
|
|
|
echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
|
|
|
|
fi
|
2013-12-02 20:41:26 +01:00
|
|
|
before_script:
|
2017-03-07 01:20:32 +01:00
|
|
|
- |
|
2017-03-11 01:05:34 +01:00
|
|
|
# Remove Xdebug for a huge performance increase, but not from nightly or hhvm:
|
2017-03-09 23:01:32 +01:00
|
|
|
stable='^[0-9\.]+$'
|
2017-03-07 01:20:32 +01:00
|
|
|
if [[ "$TRAVIS_PHP_VERSION" =~ $stable ]]; then
|
2017-03-09 23:01:32 +01:00
|
|
|
phpenv config-rm xdebug.ini
|
2017-03-07 01:20:32 +01:00
|
|
|
fi
|
2017-03-09 23:01:32 +01:00
|
|
|
- |
|
2017-03-11 01:05:34 +01: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
|
2017-03-09 23:01:32 +01:00
|
|
|
fi
|
|
|
|
- npm --version
|
|
|
|
- node --version
|
|
|
|
- nvm install 6.9.1
|
2014-12-18 00:50:37 +01:00
|
|
|
- npm install -g grunt-cli
|
|
|
|
- npm install
|
2016-05-01 22:03:59 +02:00
|
|
|
- npm prune
|
2016-05-25 08:11:20 +02:00
|
|
|
- mysql --version
|
|
|
|
- phpenv versions
|
2017-03-07 01:20:32 +01:00
|
|
|
- php --version
|
2017-03-11 01:05:34 +01:00
|
|
|
- |
|
|
|
|
# Debug PHP extensions, but not on HHVM because the command hangs indefinitely:
|
|
|
|
if [[ "$TRAVIS_PHP_VERSION" != 'hhvm' ]]; then
|
|
|
|
php -m
|
|
|
|
fi
|
2016-06-16 19:27:22 +02:00
|
|
|
- npm --version
|
|
|
|
- node --version
|
2017-03-11 01:05:34 +01:00
|
|
|
- which phpunit
|
2017-03-09 23:01:32 +01:00
|
|
|
- phpunit --version
|
|
|
|
- curl --version
|
|
|
|
- grunt --version
|
|
|
|
- git --version
|
|
|
|
- svn --version
|
2014-06-21 22:05:19 +02:00
|
|
|
script: grunt $WP_TRAVISCI
|
2014-12-18 00:50:37 +01:00
|
|
|
notifications:
|
|
|
|
slack:
|
2015-09-26 02:03:24 +02:00
|
|
|
rooms:
|
|
|
|
secure: WuMCpfgrm0GIdPbYzsGOsakZ5x7QIbEBwD+CPHVXGKbL3ZbqQ+BVcDRnMiwzxjgf1vzg2de0taXCSMGKBxsWce23NZkOnmwPdIB8XOnwDV7T7zylgYD5S7p3gI6gV0l8Y3/gROdXFZap6viC1qRr4E79ow53RKk7E3WyOo7TWqo=
|
2015-09-25 22:12:09 +02:00
|
|
|
on_start: never
|
|
|
|
on_failure: always
|
|
|
|
on_success: change
|
2016-04-20 19:08:13 +02:00
|
|
|
on_pull_requests: false
|