sudo: false

language: node_js
node_js:
  - "4"
  - "6"
  - "8"
  - "9"

env:
  - SCRIPT=test

matrix:
  include:
    - node_js: "6"
      env: SCRIPT=test:lint

cache:
  directories:
    $HOME/.npm

before_install:
  # prevent the npm loading indicator
  - npm config --global set spin false
  # if npm version is less 3.0.0 (lets say 1.x or 2.x) we should attempt to upgrade to 3
  - if [[ $(npm -v | cut -d '.' -f 1) -lt 3 ]]; then npm i -g npm@^3; fi

install:
  - travis_retry npm install --no-optional

script:
  - npm run-script $SCRIPT

language: node_js
node_js:
  - "4"
  - "6"
  - "8"
  - "9"

env:
  - SCRIPT=test

matrix:
  include:
    - node_js: "6"
      env: SCRIPT=test:lint

cache:
  directories:
    $HOME/.npm

before_install:
  # prevent the npm loading indicator
  - npm config --global set spin false
  # if npm version is less 3.0.0 (lets say 1.x or 2.x) we should attempt to upgrade to 3
  - if [[ $(npm -v | cut -d '.' -f 1) -lt 3 ]]; then npm i -g npm@^3; fi

install:
  - travis_retry npm install --no-optional

script:
  - npm run-script $SCRIPT

Remove deprecated `sudo: false` option
TravisCI: Remove deprecated `sudo: false` option

see https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration
