mirror of
https://gh.wpcy.net/https://github.com/wp-cli/scaffold-command.git
synced 2026-05-21 20:31:47 +08:00
* Explicitly identify each job in the build matrix * Run tests against PHP 7.1 and 7.0 * Only run `phpcs` once, instead of with every job * Run multisite tests on each job
59 lines
1.3 KiB
Text
59 lines
1.3 KiB
Text
sudo: false
|
|
|
|
language: php
|
|
|
|
notifications:
|
|
email:
|
|
on_success: never
|
|
on_failure: change
|
|
|
|
branches:
|
|
only:
|
|
- master
|
|
|
|
cache:
|
|
- composer
|
|
- $HOME/.composer/cache
|
|
|
|
matrix:
|
|
include:
|
|
- php: 7.1
|
|
env: WP_VERSION=latest
|
|
- php: 7.0
|
|
env: WP_VERSION=latest
|
|
{{#wp_versions_to_test}}
|
|
- php: 5.6
|
|
env: WP_VERSION={{.}}
|
|
{{/wp_versions_to_test}}
|
|
- php: 5.6
|
|
env: WP_TRAVISCI=phpcs
|
|
- php: 5.3
|
|
env: WP_VERSION=latest
|
|
|
|
before_script:
|
|
- export PATH="$HOME/.composer/vendor/bin:$PATH"
|
|
- |
|
|
if [[ ! -z "$WP_VERSION" ]] ; then
|
|
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION
|
|
if [[ ${TRAVIS_PHP_VERSION:0:2} == "7." ]]; then
|
|
composer global require "phpunit/phpunit=5.7.*"
|
|
else
|
|
composer global require "phpunit/phpunit=4.8.*"
|
|
fi
|
|
fi
|
|
- |
|
|
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
|
|
composer global require wp-coding-standards/wpcs
|
|
phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs
|
|
fi
|
|
|
|
script:
|
|
- |
|
|
if [[ ! -z "$WP_VERSION" ]] ; then
|
|
phpunit
|
|
WP_MULTISITE=1 phpunit
|
|
fi
|
|
- |
|
|
if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then
|
|
phpcs --standard=phpcs.ruleset.xml $(find . -name '*.php')
|
|
fi
|