dist: trusty
sudo: required

services:
    - docker

addons:
  apt:
    packages:
      - docker-ce

script:
    - if [ "true" = "${SHELLCHECK-}" ]; then shellcheck *.sh ; fi
    - if [ -n "${NODE_VERSION-}" ]; then ./test-build.sh $NODE_VERSION ; fi
    - if [ "true" = "${DOCTOCCHECK-}" ]; then
         nvm install node &&
         npm i -g doctoc  &&
         cp README.md README.md.tmp &&
         doctoc --title='## Table of Contents' --github README.md &&
         diff -q README.md README.md.tmp;
      fi

env:
    - DOCTOCCHECK: true
    - NODE_VERSION: '4'
    - NODE_VERSION: '6'
    - NODE_VERSION: '8'
    - NODE_VERSION: '9'

matrix:
  include:
    env: SHELLCHECK=true
    addons:
      apt:
        sources:
          - debian-sid
        packages:
          - shellcheck

dist: trusty
sudo: required

language: node_js
node_js:
    - lts/*

services:
    - docker

addons:
  apt:
    packages:
      - docker-ce

script:
    - if [ "true" = "${SHELLCHECK-}" ]; then shellcheck *.sh ; fi
    - if [ -n "${NODE_VERSION-}" ]; then ./test-build.sh $NODE_VERSION ; fi
    - if [ "true" = "${DOCTOCCHECK-}" ]; then
         npm i -g doctoc  &&
         cp README.md README.md.tmp &&
         doctoc --title='## Table of Contents' --github README.md &&
         diff -q README.md README.md.tmp;
      fi

env:
    - DOCTOCCHECK: true
    - NODE_VERSION: '4'
    - NODE_VERSION: '6'
    - NODE_VERSION: '8'
    - NODE_VERSION: '9'

matrix:
  include:
    env: SHELLCHECK=true
    addons:
      apt:
        sources:
          - debian-sid
        packages:
          - shellcheck

Set language to node_js and use latest LTS version
Set language to node_js and use latest LTS version

Also: don't install node for doc check, it's now already installed
