language: cpp
sudo: false
dist: trusty

env:
  global:
    - ELECTRON_CACHE=$HOME/.electron
    - secure: "JNX+RLuiPeubWwm7KdJBP6ugdHH1TWkmWNvmY4tH5WEhck5zPrLWMUNfAxtyKQRWJXHJis2yR65pYtVThMM4pQ6X2C0qcOy92JWCQ2K5iy9HUNcA7Je3jZABkgiBYo8A1EpiMB/lYMB13GXWT18bMVB0SltVB8fpt29J+fzTaZN+Q19RietjGfKYar3/s9weD8Ky28+dJW1Ge24ALjq3GPwuUZz5qLMGLwH3zbbL1GF81r3ICjWVYA2E+G+JL7+BnHUvyKHs2qGIylrngfe/BbObubCTiTsUgU3LfsRruoWxK4xquvypVrj7nZAOQ7V61ZBQKOxhUMjGazfYSCS1oL09XbPsMCAIGI3v5/GCq4typv/4cgdi2RJlEw6zJC5lAHj8ivVsR55A2Ga65XGxXCoaYqoWv56rzth+4jZP6mrxvepuiSW60pBDUhwTb685WA/5jX6w343AWaXBWIEe4tGORYgujwsKp5AoBzcyuvY/gm34Ii4rYngdog8aWiXwVthCCrRbGiCB9cU929n3nxiXZk4MvQzQQoyLXnwaamK8EyQg4aKx0SQKpUT63XlyKDD6NwqjvyORYe/NIgPng8TZHMKjtmvjoT/rfolAJK2XTPH9vTDU7NsPWIagr7exMxDa1gqeldWwqQW+2veUEVwKNlX2GS+hQ6xR2Q1oU8s="

matrix:
  fast_finish: true
  include:
    - os: osx
      osx_image: xcode9.3beta
    - os: linux
      env: CC=clang CXX=clang++ npm_config_clang=1
      compiler: clang

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - libgnome-keyring-dev
      - libsecret-1-dev
      - icnsutils
      - g++-4.8
      - g++-4.8-multilib
      - gcc-multilib
      - libgtk2.0-0
      - libxtst6
      - libnotify4
      - libgconf2-4
      - libgtk2.0-0:i386
      - libxtst6:i386
      - libnotify4:i386
      - libgconf2-4:i386
      - libnss3:i386
      - libasound2:i386
      - libxss1:i386
      - socat
      - libusb-1.0-0-dev
      - libudev-dev
  chrome: stable

install:
  - nvm install
  - npm install

before_script:
  - 'if [ ${TRAVIS_OS_NAME} = "linux" ]; then
      export DISPLAY=:99.0;
      sh -e /etc/init.d/xvfb start;
      sleep 3;
     fi'
  - npm run build
  - npm run lint

script:
  - set -e
  - npm run test
  - npm run release

cache:
  directories:
    - node_modules
