language: php dist: trusty sudo: false cache: directories: - vendor - node_modules - $HOME/.npm - $HOME/.composer/cache matrix: include: - php: 7.1 env: WP_VERSION=latest - php: 5.6 env: WP_VERSION=latest - php: 7.1 env: WP_TRAVISCI=phpcs before_install: - timedatectl - npm install - npm run build before_script: - export PATH="$HOME/.composer/vendor/bin:$PATH" - | if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini ]; then phpenv config-rm xdebug.ini else echo "xdebug.ini does not exist" fi - | if [[ ! -z "$WP_VERSION" ]] ; then composer install --no-dev bash tests/bin/install-wp-tests.sh wgpb_admin root '' localhost $WP_VERSION composer global require "phpunit/phpunit=4.8.*|5.7.*" fi - | if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then composer install fi script: - | if [[ ! -z "$WP_VERSION" ]] ; then phpunit npm test fi - | if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then npm run lint fi