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:
|
2020-01-02 09:51:17 +00:00
|
|
|
directories:
|
|
|
|
- vendor
|
|
|
|
- node_modules
|
|
|
|
- $HOME/.npm
|
|
|
|
- $HOME/.composer/cache
|
2018-11-27 17:12:48 +00:00
|
|
|
|
2019-12-11 15:04:25 +00:00
|
|
|
branches:
|
2020-01-02 09:51:17 +00:00
|
|
|
only:
|
|
|
|
- master
|
|
|
|
- /release\/.*/
|
2019-12-11 15:04:25 +00:00
|
|
|
|
2019-07-01 12:52:44 +00:00
|
|
|
before_install:
|
2020-01-02 09:51:17 +00:00
|
|
|
- timedatectl
|
|
|
|
- nvm install --latest-npm
|
2019-07-01 12:52:44 +00:00
|
|
|
|
|
|
|
before_script:
|
2020-01-02 09:51:17 +00:00
|
|
|
- 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
|
2020-02-11 16:13:20 +00:00
|
|
|
|
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:
|
2020-01-02 09:51:17 +00:00
|
|
|
- WP_VERSION=latest
|
2020-06-05 19:13:51 +00:00
|
|
|
- WOOCOMMERCE_BLOCKS_PHASE=3
|
2019-08-09 18:08:31 +00:00
|
|
|
script:
|
2020-01-02 09:51:17 +00:00
|
|
|
- phpunit
|
2019-08-09 18:08:31 +00:00
|
|
|
- name: PHP 5.6/unit-tests/Latest WP
|
|
|
|
php: 5.6
|
|
|
|
env:
|
2020-01-02 09:51:17 +00:00
|
|
|
- WP_VERSION=latest
|
2020-06-05 19:13:51 +00:00
|
|
|
- WOOCOMMERCE_BLOCKS_PHASE=3
|
2019-08-09 18:08:31 +00:00
|
|
|
script:
|
2020-01-02 09:51:17 +00:00
|
|
|
- phpunit
|
2019-08-09 18:08:31 +00:00
|
|
|
- name: PHP Linting Check
|
2020-02-14 20:16:58 +00:00
|
|
|
php: 7.3
|
2019-08-09 18:08:31 +00:00
|
|
|
env:
|
2020-01-02 09:51:17 +00:00
|
|
|
- WP_TRAVISCI=phpcs
|
2020-06-05 19:13:51 +00:00
|
|
|
- WOOCOMMERCE_BLOCKS_PHASE=3
|
2019-08-09 18:08:31 +00:00
|
|
|
script:
|
2020-01-02 09:51:17 +00:00
|
|
|
- npm run lint:php
|
2019-08-09 18:08:31 +00:00
|
|
|
- name: Javascript Tests
|
|
|
|
script:
|
2020-01-02 09:51:17 +00:00
|
|
|
- npm install
|
|
|
|
- npm run test
|
2020-01-31 20:04:37 +00:00
|
|
|
env:
|
2020-06-05 19:13:51 +00:00
|
|
|
- WOOCOMMERCE_BLOCKS_PHASE=3
|
2020-03-21 16:10:53 +00:00
|
|
|
- name: Javascript/CSS Lint check
|
2019-08-09 18:08:31 +00:00
|
|
|
script:
|
2020-01-02 09:51:17 +00:00
|
|
|
- npm install
|
2020-03-21 16:10:53 +00:00
|
|
|
- npm run lint:ci
|
2020-01-31 20:04:37 +00:00
|
|
|
env:
|
2020-06-05 19:13:51 +00:00
|
|
|
- WOOCOMMERCE_BLOCKS_PHASE=3
|
2020-02-11 16:13:20 +00:00
|
|
|
- name: E2E Tests
|
|
|
|
script:
|
2020-03-03 16:08:53 +00:00
|
|
|
- npm ci
|
2020-04-17 09:44:29 +00:00
|
|
|
- npm run test:e2e:up
|
2020-02-14 20:16:58 +00:00
|
|
|
- composer install
|
|
|
|
- npm run build:e2e-test
|
|
|
|
- npm run test:e2e
|
2020-02-11 16:13:20 +00:00
|
|
|
env:
|
2020-06-05 19:13:51 +00:00
|
|
|
- WOOCOMMERCE_BLOCKS_PHASE=3
|
2020-03-22 15:40:42 +00:00
|
|
|
- stage: deploy
|
|
|
|
if: (NOT type IN (pull_request)) AND (branch = master)
|
|
|
|
name: Deploy Storybook
|
|
|
|
env:
|
2020-06-05 19:13:51 +00:00
|
|
|
- WOOCOMMERCE_BLOCKS_PHASE=3
|
2020-03-22 15:40:42 +00:00
|
|
|
install:
|
|
|
|
- npm ci
|
2020-03-22 16:31:57 +00:00
|
|
|
script:
|
2020-03-22 15:40:42 +00:00
|
|
|
- npm run storybook:build
|
|
|
|
deploy:
|
|
|
|
provider: pages
|
2020-03-22 16:31:57 +00:00
|
|
|
skip_cleanup: true
|
2020-03-22 15:40:42 +00:00
|
|
|
github_token: $GITHUB_TOKEN
|
|
|
|
keep_history: true
|
|
|
|
local_dir: storybook/dist
|
|
|
|
on:
|
|
|
|
branch: master
|