Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (54 sloc) 1.99 KB
language: php
sudo: false
matrix:
allow_failures:
- php: hhvm
include:
- php: 7.1
env: WP_VERSION=master WP_MULTISITE=0 PHPLINT=1 PHPSNIFF=1 JSHINT=1
- php: 7.0
env: WP_VERSION=master WP_MULTISITE=0 PHPLINT=1
- php: 5.6
env: WP_VERSION=master WP_MULTISITE=0 PHPLINT=1
- php: 5.2
env: WP_VERSION=master WP_MULTISITE=1 PHPLINT=1
- php: 5.6
env: WP_VERSION=4.8 WP_MULTISITE=1
- php: 5.5
env: WP_VERSION=4.8 WP_MULTISITE=0
- php: 5.4
env: WP_VERSION=4.8 WP_MULTISITE=0
- php: 5.3
env: WP_VERSION=4.5 WP_MULTISITE=0 PHPLINT=1
- php: 5.6
env: WP_VERSION=3.9 WP_MULTISITE=0
- php: hhvm
env: WP_VERSION=4.8 WP_MULTISITE=0
cache:
yarn: true
directories:
- vendor
- $HOME/.composer/cache
- node_modules
before_script:
- phpenv local 5.6
- composer selfupdate --no-interaction
- composer install --no-interaction
- phpenv local --unset
- PLUGIN_SLUG=$(basename $(pwd))
- export WP_DEVELOP_DIR=/tmp/wordpress/
- git clone --depth=50 --branch="$WP_VERSION" git://develop.git.wordpress.org/ /tmp/wordpress
- cd ..
- cp -r "$PLUGIN_SLUG" "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
- cd /tmp/wordpress/
- 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
- mysql -e "CREATE DATABASE wordpress_tests;" -uroot
- cd "/tmp/wordpress/src/wp-content/plugins/$PLUGIN_SLUG"
- phpenv rehash
script:
- if [[ "$PHPLINT" == "1" ]]; then find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l; fi
- if [[ "$PHPSNIFF" == "1" ]]; then find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 vendor/bin/phpcs --standard="WordPress-Extra" -v; fi
- if [[ "$JSHINT" == "1" ]]; then yarn add global grunt-cli && yarn add grunt load-grunt-tasks grunt-contrib-jshint && grunt jshint --verbose; fi