language:        node_js
sudo:            required
dist: trusty
os:
  - linux
node_js:
  - "10.6.0"

before_install:
  - export CHROME_BIN=chromium-browser
  - export DISPLAY=:99.0
  - sh -e /etc/init.d/xvfb start

stages:
  - install
  - format
  - export
  - tests

jobs:
  include:
    - stage: install
      script: travis_retry npm install --depth 0 --silent

    - stage: format
      script: travis_retry npm run lint
      env: LABEL=lint

    - stage: export
      script: travis_retry npm run export
      env: LABEL=export
    - stage: export
      script: travis_retry npm run preview
      env: LABEL=preview

    - stage: tests
      script: travis_retry npm run test:export
      env: LABEL=test:export
    - stage: tests
      script: travis_retry npm run test:docs
      env: LABEL=test:docs
    - stage: tests
      script: travis_retry npm run test:e2e
      env: LABEL=test:e2e
