language: node_js
dist: trusty
cache: yarn
env:
  global:
    - CXX=g++-4.8
    - YARN_VERSION=1.3.2

jobs:
  include:
    - env: task=npm-test
      node_js:
        - 6
      before_install:
        - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "$YARN_VERSION"
        - export PATH="$HOME/.yarn/bin:$PATH"
    - env: task=npm-test
      node_js:
        - 7
      before_install:
        - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "$YARN_VERSION"
        - export PATH="$HOME/.yarn/bin:$PATH"
    - env: task=ShellCheck
      script:
        - shellcheck bin/heroku bin/setup
      language: generic
    - env: task=doctoc
      install: npm install doctoc
      script:
        - cp README.md README.md.orig
        - npm run doctoc
        - diff -q README.md README.md.orig
      language: generic
    - env: task=json-lint
      addons:
        apt:
          packages:
          - jq
      script:
        - npm run jsonlint
      language: generic
