2014-12-23 00:25:40 +01:00
|
|
|
sudo: false
|
2017-07-18 10:24:35 +02:00
|
|
|
dist: trusty
|
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
|
2017-04-23 13:39:43 +02:00
|
|
|
- vendor
|
|
|
|
- $HOME/.composer/cache
|
2016-05-25 08:11:20 +02:00
|
|
|
env:
|
|
|
|
global:
|
|
|
|
- WP_TRAVISCI=travis:phpunit
|
2014-06-21 22:05:19 +02:00
|
|
|
matrix:
|
|
|
|
include:
|
2018-08-17 03:50:26 +02:00
|
|
|
- php: 7.2
|
|
|
|
env: WP_TRAVISCI=travis:format
|
2017-04-15 19:42:07 +02:00
|
|
|
- php: 7.1
|
2014-12-18 00:50:37 +01:00
|
|
|
env: WP_TRAVISCI=travis:js
|
2018-12-14 06:15:54 +01:00
|
|
|
- php: 7.3
|
2017-07-27 19:37:57 +02:00
|
|
|
- php: 7.2
|
2017-07-27 23:31:40 +02:00
|
|
|
- php: 7.1
|
2017-04-15 19:42:07 +02:00
|
|
|
- php: 7.0
|
2018-01-16 21:28:42 +01:00
|
|
|
env: WP_TEST_REPORTER=true
|
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:42:07 +02:00
|
|
|
- php: 5.5
|
|
|
|
- php: 5.4
|
|
|
|
- php: 5.3
|
2017-07-18 10:24:35 +02:00
|
|
|
dist: precise
|
2017-04-15 19:42:07 +02:00
|
|
|
- php: 5.2
|
2017-07-18 10:24:35 +02:00
|
|
|
dist: precise
|
2015-10-02 18:50:53 +02:00
|
|
|
- php: nightly
|
2014-06-21 22:05:19 +02:00
|
|
|
allow_failures:
|
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
|
2018-09-15 11:21:55 +02:00
|
|
|
travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer
|
2014-12-18 00:50:37 +01:00
|
|
|
fi
|
2015-10-16 00:51:38 +02:00
|
|
|
- |
|
|
|
|
if [[ "$WP_TRAVIS_OBJECT_CACHE" == "true" ]]; then
|
2017-05-01 13:20:30 +02:00
|
|
|
cp tests/phpunit/includes/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-09 22:47:20 +01:00
|
|
|
- |
|
2017-07-27 23:31:40 +02:00
|
|
|
# Remove Xdebug for a huge performance increase:
|
|
|
|
if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then
|
2017-03-09 22:47:20 +01:00
|
|
|
phpenv config-rm xdebug.ini
|
2017-07-27 23:31:40 +02:00
|
|
|
else
|
|
|
|
echo "xdebug.ini does not exist"
|
2017-03-09 22:47:20 +01:00
|
|
|
fi
|
2017-03-09 20:13:25 +01:00
|
|
|
- |
|
2017-03-10 23:57:31 +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"; }`
|
2017-03-09 20:13:25 +01:00
|
|
|
fi
|
2017-03-10 23:57:31 +01:00
|
|
|
- |
|
|
|
|
# Install the specified version of PHPUnit depending on the PHP version:
|
2017-03-11 00:56:07 +01:00
|
|
|
if [[ "$WP_TRAVISCI" == "travis:phpunit" ]]; then
|
|
|
|
case "$TRAVIS_PHP_VERSION" in
|
2019-01-28 15:10:24 +01:00
|
|
|
7.3|7.2|7.1|nightly)
|
|
|
|
echo "Using PHPUnit 7.x"
|
|
|
|
travis_retry composer global require "phpunit/phpunit:^7"
|
|
|
|
;;
|
|
|
|
7.0)
|
2017-08-22 18:08:33 +02:00
|
|
|
echo "Using PHPUnit 6.x"
|
2018-09-15 11:21:55 +02:00
|
|
|
travis_retry composer global require "phpunit/phpunit:^6"
|
2017-04-23 04:05:12 +02:00
|
|
|
;;
|
2017-03-11 00:56:07 +01:00
|
|
|
5.6|5.5|5.4|5.3)
|
2017-08-22 18:08:33 +02:00
|
|
|
echo "Using PHPUnit 4.x"
|
2018-09-15 11:21:55 +02:00
|
|
|
travis_retry composer global require "phpunit/phpunit:^4"
|
2017-03-11 00:56:07 +01:00
|
|
|
;;
|
|
|
|
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
|
2018-08-17 03:50:26 +02:00
|
|
|
- |
|
|
|
|
# We only need to run composer install on the code formatting job.
|
|
|
|
if [[ "$WP_TRAVISCI" == "travis:format" ]]; then
|
|
|
|
composer --version
|
2018-09-15 11:21:55 +02:00
|
|
|
travis_retry composer install
|
2018-08-17 03:50:26 +02:00
|
|
|
fi
|
2017-03-09 22:08:09 +01:00
|
|
|
- npm --version
|
|
|
|
- node --version
|
2018-12-16 02:42:24 +01:00
|
|
|
- nvm install 10.13.0
|
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-02-27 23:53:46 +01:00
|
|
|
- php --version
|
2017-04-24 02:27:28 +02:00
|
|
|
- php -m
|
2016-06-16 19:27:22 +02:00
|
|
|
- npm --version
|
|
|
|
- node --version
|
2017-03-10 23:57:31 +01:00
|
|
|
- which phpunit
|
2017-03-09 20:13:25 +01:00
|
|
|
- phpunit --version
|
2017-03-09 22:47:20 +01:00
|
|
|
- curl --version
|
|
|
|
- grunt --version
|
|
|
|
- git --version
|
|
|
|
- svn --version
|
2017-04-22 23:00:07 +02:00
|
|
|
- locale -a
|
2014-06-21 22:05:19 +02:00
|
|
|
script: grunt $WP_TRAVISCI
|
2018-01-16 21:28:42 +01:00
|
|
|
after_script:
|
|
|
|
- |
|
|
|
|
if [[ "$WP_TEST_REPORTER" == "true" ]]; then
|
|
|
|
git clone https://github.com/WordPress/phpunit-test-runner.git test-runner
|
|
|
|
export WPT_PREPARE_DIR=$(pwd)
|
|
|
|
export WPT_TEST_DIR=$(pwd)
|
|
|
|
php test-runner/report.php
|
|
|
|
fi
|
2014-12-18 00:50:37 +01:00
|
|
|
notifications:
|
|
|
|
slack:
|
2015-09-26 02:03:24 +02:00
|
|
|
rooms:
|
2017-05-10 12:28:19 +02:00
|
|
|
secure: PO3x/bhYXNFqAMtzDzpOAnHcg2KzG2gGbBDft1HlqN4O8hRJqrRs7hqsEe9wKZUs6qf9Jv0ZleJ5AmcSd0DbDAFsfqeWtnWpsj8NqOIWgLX0C2idvfNRzCX1mUd6E1hlAjjTGnKn4MV3m1dRurwcDqacSBVtbXKQ+yPSgM3eXYkDz8EFbTsMcda8pFskcXr98E7/YomU0QtgOcjXndxGZ53zUQ1rfaDwUJzGY3bn5nLoweVZsSIeEFSiNcip7Kt22zVlU0SAb6QlBf3F0h9IWoRD59BQ7pkl53FWzpXoHzUYOFmn0jB5y1vHMlHvTDVEmDuumpCEqnxVvLh33AwGtqYRWH36PEfTn/u1YTFr7FS7KbwrKw9Nn+jUZe3KFrVzgQNUt0El33mO0FbSoNEWJhxRarp0D1z3/HVsbon3Fwzt/3jBHGf9nI+tHH4u7KQ70+M7pzBsV7F7Lc60YnuKrcy/hkwObGB0Za9tMHPUw3c7b4ep6nSa4ts9S++IijLWDaNAq7K/j7fAfI1JrkPIw4T6PcGpNAADkmlCrvToKE4axExaJke/lkUb+3Pwdj0h7ePzPSrHT8aASlKFM1PuI1KRMn/J4wRLtGeLlfYXvVlaQYmJobJtYgoiNWJWMIybLGVBSVPohdGO3qIJbl8WNPN1cW2ZZTcEBprLe8y7MSo=
|
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
|