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 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 and Bundle Size Check script: - npm install - npm run build:ci env: - WOOCOMMERCE_BLOCKS_PHASE=experimental - name: E2E Tests script: - npm install - npm run docker:up - composer install - npm run build:e2e-test - npm run test:e2e env: - WOOCOMMERCE_BLOCKS_PHASE=experimental