sudo: false
dist: trusty
language: node_js
node_js: 8.9

cache:
  directories:
    - node_modules

before_script:
  - npm install -g bower
  - bower install

env:
  - POLYMER=2
  - POLYMER=3

script:
  - if [[ "$POLYMER" = "2" ]]; then
      npm install -g polymer-cli &&
      npm install &&
      if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
        npm i --no-save gemini@^4.0.0 gemini-sauce gemini-polyserve;
        gemini test test/visual;
      fi;
    fi

  - if [[ "$POLYMER" = "3" ]]; then
      npm install -g yarn magi-cli polymer-cli@next &&
      (cd .. && git clone --depth 1 -b vaadin-components git://github.com/web-padawan/polymer-modulizer.git && cd polymer-modulizer && npm link) &&
      rm -rf node_modules &&
      magi p3-convert --out . --import-style=name &&
      yarn install --flat;
    fi
    # TODO: Visual tests are excluded because gemini-polyserve doesn't support Polymer 3

  - if [[ "$TRAVIS_EVENT_TYPE" = "cron" ]]; then
      npm install &&
      polymer test --env saucelabs-cron;
    fi

sudo: false
dist: trusty
language: node_js
node_js: 8.9

cache:
  directories:
    - node_modules

before_script:
  - npm install -g bower polymer-cli@next
  - bower install

env:
  - POLYMER=2
  - POLYMER=3

script:
  - if [[ "$POLYMER" = "2" ]]; then
      npm install &&
      if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
        npm i --no-save gemini@^4.0.0 gemini-sauce gemini-polyserve;
        gemini test test/visual;
      fi;
    fi

  - if [[ "$POLYMER" = "3" ]]; then
      npm install -g yarn magi-cli &&
      (cd .. && git clone --depth 1 -b vaadin-components-next git://github.com/web-padawan/polymer-modulizer.git && cd polymer-modulizer && npm link) &&
      rm -rf node_modules &&
      magi p3-convert --out . --import-style=name &&
      yarn install --flat;
    fi
    # TODO: Visual tests are excluded because gemini-polyserve doesn't support Polymer 3

  - if [[ "$TRAVIS_EVENT_TYPE" = "cron" ]]; then
      npm install &&
      polymer test --env saucelabs-cron;
    fi

Update to use latest modulizer and webcomponents polyfill
Update to use latest modulizer and webcomponents polyfill
