woocommerce/plugins/woocommerce-blocks/.travis.yml

107 lines
2.8 KiB
YAML
Raw Normal View History

language: php
dist: trusty
sudo: false
cache:
directories:
- vendor
- node_modules
- $HOME/.npm
- $HOME/.composer/cache
branches:
only:
- master
- /release\/.*/
before_install:
- timedatectl
- nvm install --latest-npm
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
Fix wp-cli container permissions issues for e2e docker test environment (https://github.com/woocommerce/woocommerce-blocks/pull/1716) * add docker files * get tests to work * remove irrelevant files * change userAgent to chrome * add woocommerce as a dep * add jest to eslint * remove eslintignore for tests * undo travis chages till another PR * remove local utils and call them directly from woocommerce * update deps * add setup files to run tests * export default wp link * wait for select before selecting * remove travis db * ignore e2e tests in unit testing * add tests * add docker commands * always run composer * Make it possible to import directly from '@woocommerce/e2e-tests/utils' * remove installing woocommerce via composer. * add more docker npm scripts * add custom docker config for wp-cli * add changes to docker-composer.yml Includes reading environment variables from `.env` * revert customizations to .travis.yml * move main docker file for the wordpress container to bin * fix travis config * rename wp install for travis builds back to original name * use a version of docker-compose that travis supports * add minor change to try and force travis test run * fix incorrect command * copy composer lock from master * only run phpcs on /src directory * give time for host to spin up for e2e tests * increase sleep for waiting on container * make sure plugin is built before running tests * sigh fix improper command usage Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com> Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2020-02-11 16:13:20 +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
- WOOCOMMERCE_BLOCKS_PHASE=experimental
script:
- phpunit
- name: PHP 5.6/unit-tests/Latest WP
php: 5.6
env:
- WP_VERSION=latest
- WOOCOMMERCE_BLOCKS_PHASE=experimental
script:
- phpunit
- name: PHP Linting Check
php: 7.3
env:
- WP_TRAVISCI=phpcs
- WOOCOMMERCE_BLOCKS_PHASE=experimental
script:
- npm run lint:php
- name: Javascript Tests
script:
- npm install
- npm run test
env:
- WOOCOMMERCE_BLOCKS_PHASE=experimental
- name: Javascript/CSS Lint check
script:
- npm install
- npm run lint:ci
env:
- WOOCOMMERCE_BLOCKS_PHASE=experimental
Fix wp-cli container permissions issues for e2e docker test environment (https://github.com/woocommerce/woocommerce-blocks/pull/1716) * add docker files * get tests to work * remove irrelevant files * change userAgent to chrome * add woocommerce as a dep * add jest to eslint * remove eslintignore for tests * undo travis chages till another PR * remove local utils and call them directly from woocommerce * update deps * add setup files to run tests * export default wp link * wait for select before selecting * remove travis db * ignore e2e tests in unit testing * add tests * add docker commands * always run composer * Make it possible to import directly from '@woocommerce/e2e-tests/utils' * remove installing woocommerce via composer. * add more docker npm scripts * add custom docker config for wp-cli * add changes to docker-composer.yml Includes reading environment variables from `.env` * revert customizations to .travis.yml * move main docker file for the wordpress container to bin * fix travis config * rename wp install for travis builds back to original name * use a version of docker-compose that travis supports * add minor change to try and force travis test run * fix incorrect command * copy composer lock from master * only run phpcs on /src directory * give time for host to spin up for e2e tests * increase sleep for waiting on container * make sure plugin is built before running tests * sigh fix improper command usage Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com> Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2020-02-11 16:13:20 +00:00
- name: E2E Tests
script:
- npm ci
- npm run docker:up
- composer install
- npm run build:e2e-test
- npm run test:e2e
Fix wp-cli container permissions issues for e2e docker test environment (https://github.com/woocommerce/woocommerce-blocks/pull/1716) * add docker files * get tests to work * remove irrelevant files * change userAgent to chrome * add woocommerce as a dep * add jest to eslint * remove eslintignore for tests * undo travis chages till another PR * remove local utils and call them directly from woocommerce * update deps * add setup files to run tests * export default wp link * wait for select before selecting * remove travis db * ignore e2e tests in unit testing * add tests * add docker commands * always run composer * Make it possible to import directly from '@woocommerce/e2e-tests/utils' * remove installing woocommerce via composer. * add more docker npm scripts * add custom docker config for wp-cli * add changes to docker-composer.yml Includes reading environment variables from `.env` * revert customizations to .travis.yml * move main docker file for the wordpress container to bin * fix travis config * rename wp install for travis builds back to original name * use a version of docker-compose that travis supports * add minor change to try and force travis test run * fix incorrect command * copy composer lock from master * only run phpcs on /src directory * give time for host to spin up for e2e tests * increase sleep for waiting on container * make sure plugin is built before running tests * sigh fix improper command usage Co-authored-by: Seghir Nadir <nadir.seghir@gmail.com> Co-authored-by: Albert Juhé Lluveras <aljullu@gmail.com>
2020-02-11 16:13:20 +00:00
env:
- WOOCOMMERCE_BLOCKS_PHASE=experimental
- stage: deploy
if: (NOT type IN (pull_request)) AND (branch = master)
name: Deploy Storybook
env:
- WOOCOMMERCE_BLOCKS_PHASE=experimental
script:
- #ignore default phpunit build!
install:
- npm ci
before_deploy:
- npm run storybook:build
deploy:
provider: pages
cleanup: false
github_token: $GITHUB_TOKEN
keep_history: true
local_dir: storybook/dist
on:
branch: master