language: cpp

os:
  - linux
  - osx

sudo: false

addons:
  apt:
    sources: [ 'ubuntu-toolchain-r-test' ]
    # for testing node-webkit
    packages: ['g++-4.8', 'xvfb','libasound2','libx11-6','libglib2.0-0','libgtk2.0-0','libatk1.0-0','libgdk-pixbuf2.0-0','libcairo2','libfreetype6','libfontconfig1','libxcomposite1','libasound2','libxdamage1','libxext6','libxfixes3','libnss3','libnspr4','libgconf-2-4','libexpat1','libdbus-1-3','libudev0']


env:
  matrix:
   - NODE_VERSION="0.10.38" RETIRE=true
   - NODE_VERSION="4"
   - NODE_VERSION="5"
   - NODE_VERSION="6"
   - NODE_VERSION="7"
  global:
   - secure: nxPEbegqL+ckZ03BvGJSOlfcNuoJvj+rkLbBmmOEuTrk79lvY0+gjpmvWu4gGXMt89Vz+iAJB29ERaUdriKzlmYmebhWEdwQ/aayUv2sNA0eduvr4TALW2iLfLqryeE4449xnuEvz469AVWxO8xoX9KgmrwTLnkMR9SbQHxB6jU=
   - secure: Fs0ilCVBL0DUMkd5vzLGL/5K364kLj1LpSKzwZpPvlU6Gx2jW+Zt59RfM1yOTCvrPWWNb+jc8jz8lbbPXAgUnYNmL54WkIjapr8yPIClw6AtNOSuPtL+zGVGT7FZEO7EntNuEtTer6Wj8IuWUT7myeAezKzNogYg7HyaO4JsoJc=
   - secure: ovgkAH1h18pGmoYWN/2tWLF1lqaAK74eK1vnNFB5FMq3wTZYXpzM1W9nT3uqaDsNBUbs/groMcCDU/WBvfQtz9DcocVkuSCVgQ+6MaVVIuH7z7erfIe2sNdq0yhjT4KgBjTZcu6ccVSLjNNQwWctOiPuVgMOLacpN1PuPfs7KCk=

before_install:
- if [[ $(uname -s) == 'Linux' ]]; then
     export CXX="g++-4.8";
  fi;
- source ./scripts/install_node.sh ${NODE_VERSION}
- npm config set loglevel=error

install:
- npm install

before_script:
- npm test
- if [[ ${RETIRE:-false} == true ]]; then ./node_modules/.bin/retire -n; fi;
# test node-webkit usage
- ./scripts/test-node-webkit.sh

script:
# test non-authenticated mode
- unset node_pre_gyp_accessKeyId
- npm test
