# use the latest ubuntu distro
dist: trusty
# require sudo
sudo: required

# this is a node project
language: node_js
node_js:
- '8'
- '9'
- 'node'

addons:
  apt:
    sources:
      - ubuntu-toolchain-r-test

git:
  submodules: false

before_install: |
  [[ ! -x ~/npm/node_modules/.bin/npm ]] && {
    cd ~/npm && npm install npm
    cd -
  } || true
env:
  global:
    - PATH=~/npm/node_modules/.bin:$PATH
    - http_proxy=''
    - HTTP_PROXY=''
    - workerCount=3 timeout=600000
    - NODE_ENV=development
matrix:
  fast_finish: true
install:
  - npm i
cache:
  directories:
    - ~/.npm # cache npm's cache
    - ~/npm # cache latest npm
    - node_modules
before_script: npm install -g npm && node -v && npm -v
script:
  - npm run test:prod