language: node_js
sudo: required  # See http://docs.travis-ci.com/user/trusty-ci-environment/
dist: trusty
node_js:
  - "lts/*"
python:
  - "2.7"
before_install:
  - export DISPLAY=:99.0
  - unset _JAVA_OPTIONS  # JVM heap sizes break closure compiler. #11203.
  - sh -e /etc/init.d/xvfb start
  # Install yarn
  - curl -o- -L https://yarnpkg.com/install.sh | bash
  - export PATH=$HOME/.yarn/bin:$PATH
before_script:
  - export PATH="`pwd`/node_modules/.bin:$PATH"
jobs:
  include:
    - stage: check
      name: 'Check'
      script:
        - gulp check
    - stage: unit
      name: 'Unit Tests'
      script:
        - gulp unit --coverage
    - stage: E2E
      name: 'End to End Tests'
      script:
        - gulp e2e
branches:
  only:
    - master
addons:
  chrome: stable
matrix:
  include:
    - env: BUILD_SHARD="unit_tests"
      addons:
        hosts:
          - pub.localhost
          - sp.localhost
cache:
  directories:
    - node_modules
  bundler: true
  yarn: true
after_success:
  - ./node_modules/.bin/codecov -f test/coverage/lcov-unit.info

language: node_js
sudo: required  # See http://docs.travis-ci.com/user/trusty-ci-environment/
dist: trusty
node_js:
  - "lts/*"
python:
  - "2.7"
before_install:
  - export DISPLAY=:99.0
  - unset _JAVA_OPTIONS  # JVM heap sizes break closure compiler. #11203.
  - sh -e /etc/init.d/xvfb start
  # Install yarn
  - curl -o- -L https://yarnpkg.com/install.sh | bash
  - export PATH=$HOME/.yarn/bin:$PATH
before_script:
  - export PATH="`pwd`/node_modules/.bin:$PATH"
jobs:
  include:
    - stage: check
      name: 'Check'
      script:
        - gulp check
    - stage: unit
      name: 'Unit Tests'
      script:
        - gulp unit --coverage
    - # in the same stage as unit
      name: 'End to End Tests'
      script:
        - gulp e2e
branches:
  only:
    - master
addons:
  chrome: stable
matrix:
  include:
    - env: BUILD_SHARD="unit_tests"
      addons:
        hosts:
          - pub.localhost
          - sp.localhost
cache:
  directories:
    - node_modules
  bundler: true
  yarn: true
after_success:
  - ./node_modules/.bin/codecov -f test/coverage/lcov-unit.info

Make unit and e2e tests jobs run parallel in Travis
Make unit and e2e tests jobs run parallel in Travis
