2019-07-01 12:52:44 +00:00
|
|
|
language: php
|
2018-11-27 17:12:48 +00:00
|
|
|
|
|
|
|
dist: trusty
|
|
|
|
|
2019-07-01 12:52:44 +00:00
|
|
|
sudo: false
|
2018-11-27 17:12:48 +00:00
|
|
|
|
2019-07-01 12:52:44 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- vendor
|
|
|
|
- node_modules
|
|
|
|
- $HOME/.npm
|
|
|
|
- $HOME/.composer/cache
|
2018-11-27 17:12:48 +00:00
|
|
|
|
2019-07-01 12:52:44 +00:00
|
|
|
before_install:
|
|
|
|
- timedatectl
|
2019-10-21 15:26:53 +00:00
|
|
|
- nvm install
|
|
|
|
- npm rebuild
|
2019-07-01 12:52:44 +00:00
|
|
|
|
|
|
|
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
|
2019-08-09 18:08:31 +00:00
|
|
|
# also installs woocommerce plugin
|
2019-07-01 12:52:44 +00:00
|
|
|
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
|
2019-08-09 18:08:31 +00:00
|
|
|
jobs:
|
|
|
|
fast_finish: true
|
|
|
|
include:
|
|
|
|
- stage: build tests
|
|
|
|
name: PHP 7.1/unit-tests/Latest WP
|
|
|
|
php: 7.1
|
|
|
|
env:
|
|
|
|
- WP_VERSION=latest
|
|
|
|
script:
|
|
|
|
- phpunit
|
|
|
|
- name: PHP 5.6/unit-tests/Latest WP
|
|
|
|
php: 5.6
|
|
|
|
env:
|
|
|
|
- WP_VERSION=latest
|
|
|
|
script:
|
|
|
|
- phpunit
|
|
|
|
- name: PHP Linting Check
|
|
|
|
php: 7.1
|
|
|
|
env:
|
|
|
|
- WP_TRAVISCI=phpcs
|
|
|
|
script:
|
|
|
|
- npm run lint:php
|
|
|
|
- name: Javascript Tests
|
|
|
|
script:
|
|
|
|
- npm install
|
|
|
|
- npm run test
|
|
|
|
- name: Javascript/CSS Lint and Bundle Size Check
|
|
|
|
script:
|
|
|
|
- npm install
|
2019-10-21 15:26:53 +00:00
|
|
|
- npm run build:ci
|