language: cpp

# http://docs.travis-ci.com/user/multi-os/
os:
  - linux
  - osx

env:
  matrix:
   - NODE_VERSION="0.8"
   - NODE_VERSION="0.10"
   - NODE_VERSION="0.11"
   - NODE_WEBKIT="0.8.6" TARGET_ARCH="ia32"
   - NODE_WEBKIT="0.8.6" TARGET_ARCH="x64"
   - NODE_WEBKIT="0.10.1" TARGET_ARCH="ia32"
   - NODE_WEBKIT="0.10.1" TARGET_ARCH="x64"
  global:
    - secure: QhuP5E/kYL1j1KDkHGJtk6DSJr1RH4DR/JrC62Viuf5Du8jE+i0kPWfF2MxtuEmKo35orhpu8t8mzKygWfuO63WPuuIE9qd/+V/y99Lqcj0tEN6wJ5RnywktbTJWg23zphjhmYq3Xj8DLVEikCZBwHtlbygkO9Q60cn1PK+bnPg=
    - secure: HxCS2dQAWI0KmCFnFNNZoucG4FeAW+itG7+Hp0dNtwmxZzGOZYFO2bZcGvTAMNfVN++oqLxTebYQI1oB5yUl5mPJjrjthaGS6Zq3S6rfJcXiv+icYgEXlR6ejQ97dsHw1Jeg8nedCQlI4kHfvG6pgBLhq9hnugxH1Cjhdt14E9U=

matrix:
  allow_failures:
    - env: NODE_WEBKIT="0.8.6" TARGET_ARCH="x64"
      os: osx
    - env: NODE_WEBKIT="0.10.0" TARGET_ARCH="x64"
      os: osx

before_install:
# check if tag exists and matches package.json
- scripts/validate_tag.sh

install:
# put node-pre-gyp on path
- export PATH=./node_modules/.bin/:$PATH

before_script:
# get commit message
- export COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')

script:
- if [[ "${NODE_VERSION}" ]]; then ./scripts/build_against_node.sh; fi;
- if [[ "${NODE_WEBKIT}" ]]; then ./scripts/build_against_node_webkit.sh; fi;
