2019-08-12 10:28:33 +02:00
|
|
|
language: generic
|
|
|
|
|
2019-08-05 09:09:14 +02:00
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- docker-ce
|
|
|
|
|
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:
|
2019-03-25 01:51:12 +01:00
|
|
|
- $HOME/.npm
|
2017-04-23 13:39:43 +02:00
|
|
|
- vendor
|
2019-08-05 09:09:14 +02:00
|
|
|
|
2016-05-25 08:11:20 +02:00
|
|
|
env:
|
|
|
|
global:
|
2019-08-07 13:54:22 +02:00
|
|
|
- LOCAL_DIR: build
|
2019-08-15 01:11:39 +02:00
|
|
|
- COMPOSER_INSTALL: false
|
|
|
|
- NPM_INSTALL: true
|
|
|
|
- WP_INSTALL: true
|
2019-08-05 09:09:14 +02:00
|
|
|
|
2014-06-21 22:05:19 +02:00
|
|
|
matrix:
|
|
|
|
include:
|
2019-08-05 09:09:14 +02:00
|
|
|
- env: WP_TRAVISCI=test:e2e
|
2019-08-07 13:54:22 +02:00
|
|
|
name: E2E Tests
|
2019-08-15 01:11:39 +02:00
|
|
|
- env: WP_TRAVISCI=lint:php COMPOSER_INSTALL=true NPM_INSTALL=false WP_INSTALL=false
|
2019-08-07 13:54:22 +02:00
|
|
|
name: PHP Linting
|
2019-08-15 01:11:39 +02:00
|
|
|
- env: WP_TRAVISCI=travis:js WP_INSTALL=false
|
2019-08-07 13:54:22 +02:00
|
|
|
name: JS Tests
|
2019-08-05 09:09:14 +02:00
|
|
|
- env: LOCAL_PHP=7.3-fpm WP_TRAVISCI=test:php
|
2019-08-07 13:54:22 +02:00
|
|
|
name: "PHPUnit Tests: PHP 7.3"
|
|
|
|
- env: LOCAL_PHP=7.3-fpm LOCAL_PHP_MEMCACHED=true WP_TRAVISCI=test:php
|
|
|
|
name: "PHPUnit Tests: PHP 7.3 with Memcached"
|
2019-08-05 09:09:14 +02:00
|
|
|
- env: LOCAL_PHP=7.2-fpm WP_TRAVISCI=test:php
|
2019-08-07 13:54:22 +02:00
|
|
|
name: "PHPUnit Tests: PHP 7.2"
|
2019-08-05 09:09:14 +02:00
|
|
|
- env: LOCAL_PHP=7.1-fpm WP_TRAVISCI=test:php
|
2019-08-07 13:54:22 +02:00
|
|
|
name: "PHPUnit Tests: PHP 7.1"
|
2019-08-05 09:09:14 +02:00
|
|
|
- env: LOCAL_PHP=7.0-fpm WP_TEST_REPORTER=true WP_TRAVISCI=test:php
|
2019-08-07 13:54:22 +02:00
|
|
|
name: "PHPUnit Tests: PHP 7.0"
|
2019-08-05 09:09:14 +02:00
|
|
|
- env: LOCAL_PHP=5.6-fpm WP_TRAVISCI=test:php
|
2019-08-07 13:54:22 +02:00
|
|
|
name: "PHPUnit Tests: PHP 5.6"
|
|
|
|
- env: LOCAL_PHP=7.4-fpm WP_TRAVISCI=test:php
|
|
|
|
name: "PHPUnit Tests: PHP 7.4"
|
|
|
|
- env: LOCAL_PHP=8.0-fpm WP_TRAVISCI=test:php
|
|
|
|
name: "PHPUnit Tests: PHP 8.0"
|
2014-06-21 22:05:19 +02:00
|
|
|
allow_failures:
|
2019-08-07 13:54:22 +02:00
|
|
|
- env: LOCAL_PHP=7.4-fpm WP_TRAVISCI=test:php
|
|
|
|
- env: LOCAL_PHP=8.0-fpm WP_TRAVISCI=test:php
|
2019-03-25 17:07:01 +01:00
|
|
|
fast_finish: true
|
2019-08-05 09:09:14 +02:00
|
|
|
|
2014-06-21 22:05:19 +02:00
|
|
|
before_install:
|
2019-08-05 09:09:14 +02:00
|
|
|
- |
|
|
|
|
if [[ "$WP_TRAVISCI" == "test:php" ]]; then
|
|
|
|
travis_retry svn checkout https://plugins.svn.wordpress.org/wordpress-importer/tags/0.6.3/ tests/phpunit/data/plugins/wordpress-importer
|
|
|
|
fi
|
|
|
|
- |
|
|
|
|
sudo rm /usr/local/bin/docker-compose
|
|
|
|
curl -L https://github.com/docker/compose/releases/download/1.24.0/docker-compose-`uname -s`-`uname -m` > docker-compose
|
|
|
|
chmod +x docker-compose
|
|
|
|
sudo mv docker-compose /usr/local/bin
|
|
|
|
|
2013-12-02 20:41:26 +01:00
|
|
|
before_script:
|
2017-03-09 22:47:20 +01:00
|
|
|
- |
|
2019-08-15 01:11:39 +02:00
|
|
|
if [[ "$COMPOSER_INSTALL" == "true" ]]; then
|
|
|
|
docker-compose run --rm php composer --version
|
|
|
|
docker-compose run --rm php 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
|
2019-08-15 01:11:39 +02:00
|
|
|
- |
|
|
|
|
if [[ "$NPM_INSTALL" == "true" ]]; then
|
|
|
|
npm ci
|
|
|
|
fi
|
2019-08-05 09:09:14 +02:00
|
|
|
- |
|
|
|
|
if [[ "$WP_TRAVISCI" == "test:e2e" ]] || [[ "$WP_TRAVISCI" == "test:php" ]]; then
|
|
|
|
npm run env:start
|
|
|
|
npm run build
|
2019-08-12 10:28:33 +02:00
|
|
|
docker-compose run --rm mysql mysql --version
|
|
|
|
docker-compose run --rm php php --version
|
|
|
|
docker-compose run --rm php php -m
|
|
|
|
docker-compose run --rm phpunit phpunit --version
|
2019-08-07 13:54:22 +02:00
|
|
|
fi
|
|
|
|
- |
|
|
|
|
if [[ "$LOCAL_PHP_MEMCACHED" == "true" ]]; then
|
|
|
|
cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php
|
2019-08-12 10:28:33 +02:00
|
|
|
# The memcached server needs to start after `npm run env:start`, which sets up the Docker network.
|
|
|
|
docker run --name memcached --net wordpress-develop_wpdevnet -d memcached
|
2019-08-05 09:09:14 +02:00
|
|
|
fi
|
|
|
|
- |
|
2019-08-15 01:11:39 +02:00
|
|
|
if [[ "$WP_INSTALL" == "true" ]]; then
|
2019-08-12 10:28:33 +02:00
|
|
|
# Run the install process after memcached has started.
|
2019-08-05 09:09:14 +02:00
|
|
|
npm run env:install
|
|
|
|
fi
|
2016-06-16 19:27:22 +02:00
|
|
|
- npm --version
|
|
|
|
- node --version
|
2017-03-09 22:47:20 +01:00
|
|
|
- curl --version
|
|
|
|
- git --version
|
|
|
|
- svn --version
|
2019-09-14 21:27:46 +02:00
|
|
|
- php --version
|
|
|
|
- php -i
|
2017-04-22 23:00:07 +02:00
|
|
|
- locale -a
|
2019-08-05 09:09:14 +02:00
|
|
|
|
2019-06-27 13:26:58 +02:00
|
|
|
script:
|
2019-08-05 09:09:14 +02:00
|
|
|
- |
|
|
|
|
if [[ "$WP_TRAVISCI" == "test:e2e" ]]; then
|
|
|
|
npm run test:e2e
|
|
|
|
elif [[ "$WP_TRAVISCI" == "test:php" ]]; then
|
2019-08-12 10:28:33 +02:00
|
|
|
npm run test:php -- --verbose -c phpunit.xml.dist &&
|
|
|
|
npm run test:php -- --verbose -c phpunit.xml.dist --group ajax &&
|
|
|
|
npm run test:php -- --verbose -c tests/phpunit/multisite.xml &&
|
|
|
|
npm run test:php -- --verbose -c tests/phpunit/multisite.xml --group ms-files &&
|
|
|
|
npm run test:php -- --verbose -c phpunit.xml.dist --group external-http &&
|
2019-08-19 04:17:50 +02:00
|
|
|
npm run test:php -- --verbose -c phpunit.xml.dist --group restapi-jsclient &&
|
|
|
|
# __fakegroup__ is excluded to force PHPUnit to ignore the <exclude> settings in phpunit.xml.dist.
|
|
|
|
LOCAL_PHP_XDEBUG=true npm run test:php -- -v --group xdebug --exclude-group __fakegroup__
|
2019-08-15 01:11:39 +02:00
|
|
|
elif [[ "$WP_TRAVISCI" == "lint:php" ]]; then
|
|
|
|
docker-compose run --rm php composer format &&
|
|
|
|
docker-compose run --rm php composer lint:errors &&
|
|
|
|
docker-compose run --rm php composer lint tests
|
2019-08-05 09:09:14 +02:00
|
|
|
else
|
|
|
|
npm run grunt $WP_TRAVISCI
|
|
|
|
fi
|
|
|
|
|
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
|
2019-08-12 10:28:33 +02:00
|
|
|
docker-compose run --rm -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php
|
2018-01-16 21:28:42 +01:00
|
|
|
fi
|
2019-08-05 09:09:14 +02:00
|
|
|
|
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
|