language: node_js

node_js:
- '0.10.16'
- '0.11'
- '0.12'
- 'iojs'
- '4'
- '5'
- '6'

services:
- redis-server

script:
- npm run test:cov || npm run test:cov || npm run test:cov

env:
- CXX=g++-4.8 INSTALL_HIREDIS="yes"
- INSTALL_HIREDIS="no"

before_script:
- if [ "$INSTALL_HIREDIS" = "yes" ]; then npm install hiredis; fi

addons:
  apt:
    sources:
    - ubuntu-toolchain-r-test
    packages:
    - g++-4.8
  code_climate:
    repo_token: 4cee2f60edbf31acac6ddff823f0b93e2e9882c3e5c55130049e0fd878549f84

after_success:
- if [ "$INSTALL_HIREDIS" = "yes" ]; then cat ./coverage/lcov.info | ./node_modules/.bin/codeclimate; fi
