language: node_js
dist: trusty
addons:
  apt:
    packages:
      # This is required to run new chrome on old trusty
      - libnss3
notifications:
  email: false
cache:
  directories:
    - node_modules
# allow headful tests
before_install:
  - "sysctl kernel.unprivileged_userns_clone=1"
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
script:
  - 'if [ "$NODE8" = "true" ]; then npm run lint; fi'
  - 'if [ "$NODE8" = "true" ]; then npm run coverage; fi'
  - 'if [ "$NODE8" = "true" ]; then npm run test-doclint; fi'
  - 'if [ "$NODE8" = "true" ]; then npm run bundle; fi'
  - 'if [ "$NODE8" = "true" ]; then npm run unit-bundle; fi'
  - 'if [ "$NODE6" = "true" ]; then npm run unit-node6; fi'
jobs:
  include:
    - node_js: "8.11.3"
      env: NODE8=true
    - node_js: "6.12.3"
      env: NODE6=true
before_deploy: "npm run apply-next-version"
deploy:
  provider: npm
  email: aslushnikov@gmail.com
  api_key:
    secure: YceCJ1DbVuSvZLB95vBY3xtatihhlZ4fo6KWrGnwCp+EVf4Wpgf7cmDPpxkSyCkUxoyVp81LR1blDA2PvZtxYT00vMYlQCpbLIOKSrPhDP2+VkkhGzDhfov6Ft62QpyRZYOfu4zwU13DFoEI8tVkXm7XlYaaUHqZIOZHo2KfMNd5N9Jc3KfOMWh3xZlXvgnL/68FqX2nXAzoZUjpktz0U4gF5sMRlqNcXtzF3YwHvEagFVfq8OGV0rzpAqkm4c+u0Q2IMBcmdJN3doK2IS58UjG55nAw4E53OMlucR2GW61Sh2WnuyR0011N9nlVYlaicFZmGCQM9IU+0JjXEoYZcXgqOrfYPX2NpUnT7E9rHflmFkbNZ5dKf3NVXAdKR4CcpGDg4TG2xnwaTf8lrEoap5+Rh+XHyro186MxfRT9fUcIKWnr24UGJlCj7gdS7yirGPgYv0godV83xVY9HSJXZGYZPL6568DtpMwFvhYmtPeVdqi9+7COYgW4COAxX/laRyTCRiC5X6TyEhz70UGJkpfkl12zHUCQg9S+iVrkZ3KuESTWBYotNFFWmy8jyDoGS+7tz9gY5XnmEgCcWgCNrPUUQsvSrmUxPheMnLYGb0arePLPkAEaw/GzSrJiwYbijDi/1Y3bUJ4fAhSgYP37gI2f7/wt9pVxy5A7ZX0MNgg=
  on:
    branch: master
    condition: "$NODE8 = true"
  skip_cleanup: true
  tag: next