sudo: true
dist: trusty
language: node_js
node_js: 8.11

cache:
  directories:
    - node_modules

addons:
  firefox: latest
  chrome: stable

env:
  - POLYMER=2
  - POLYMER=3

script:
  - if [[ "$POLYMER" = "2" ]]; then
      npm -q i && npm i -q --no-save bower polymer-cli && bower -q i &&
      polymer lint --rules polymer-2 --input ./src/*.html ./theme/**/*.html &&
      if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
        npm i -q --no-save gemini@^4.0.0 gemini-sauce gemini-polyserve &&
        gemini test test/visual;
      fi;
    fi
  - if [[ "$POLYMER" = "3" ]]; then
      npm --no-save -q install -g yarn bower magi-cli web-component-tester &&
      (cd .. && git clone --depth 1 -b vaadin-components-rc git://github.com/web-padawan/polymer-modulizer.git && cd polymer-modulizer && npm -q 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

sudo: true
dist: trusty
language: node_js
node_js: 8.11

cache:
  directories:
    - node_modules

addons:
  firefox: latest
  chrome: stable

env:
  - POLYMER=2
  - POLYMER=3

script:
  - if [[ "$POLYMER" = "2" ]]; then
      npm -q i && npm i -q --no-save bower polymer-cli && bower -q i &&
      polymer lint --rules polymer-2 --input ./src/*.html ./theme/**/*.html &&
      if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
        npm i -q --no-save gemini@^4.0.0 gemini-sauce gemini-polyserve &&
        gemini test test/visual;
      fi;
    fi
  - if [[ "$POLYMER" = "3" ]]; then
      npm --no-save -q install -g yarn bower magi-cli web-component-tester polymer-modulizer &&
      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

Align with skeleton: use stable polymer-modulizer
Align with skeleton: use stable polymer-modulizer
