
# Build matrix
language: node_js
matrix:
  include:

    # Run lint only in Node.js 6.x
    - node_js: '6'
      env: LINT=true

    # Run tests in Node.js 4.x
    - node_js: '4'

    # Run tests in Node.js 5.x
    - node_js: '5'

    # Run tests in Node.js 6.x
    - node_js: '6'

# Dependencies require GCC 4.8
addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test
    packages:
      - gcc-4.8
      - g++-4.8

# Restrict builds on branches
branches:
  only:
    - master
    - /^\d+\.\d+\.\d+$/

# Before install
before_install:
  # Use GCC 4.8 if it's available
  - 'if [ ! `which gcc-4.8` == "" ]; then export CXX=g++-4.8 && export CC=gcc-4.8; fi'
  # Install coveralls
  #- npm install coveralls

# Build script
script:
  - 'if [ $LINT ]; then make lint; fi'
  - 'if [ ! $LINT ]; then make lcov-levels; fi'
  #- 'if [ ! $LINT ]; then cat ./coverage/lcov.info | ./node_modules/.bin/coveralls; fi'
