Permalink
98 lines (82 sloc) 2.47 KB
###
### .travis.yml
###
# these are executed in order. each must pass for the next to be run
stages:
- smoke # this ensures a "user" install works properly
- precache # warm up cache for default Node.js version
- lint # lint code and docs
- test # all tests
# defaults
language: node_js
node_js: '11'
addons:
apt:
packages:
- libnotify-bin
# `nvm install` happens before the cache is restored, which means
# we must install our own npm elsewhere (`~/npm`)
before_install: |
[[ ! -x ~/npm/node_modules/.bin/npm ]] && {
# caching feature creates `~/npm` for us
cd ~/npm && npm install npm
cd -
} || true
# avoids bugs around https://github.com/travis-ci/travis-ci/issues/5092
export PATH=~/npm/node_modules/.bin:$PATH
# this avoids compilation in most cases (where we don't need it)
install: npm ci --ignore-scripts
cache:
directories:
- ~/.npm # cache npm's cache
- ~/npm # cache latest npm
jobs:
include:
- script: COVERAGE=1 npm start test.node
after_success: npm start coveralls
- &node
script: npm start test.node
node_js: '10'
- <<: *node
node_js: '8'
- <<: *node
node_js: '6'
- script: npm start test.bundle test.browser
install: npm ci # we need the native modules here
addons:
artifacts:
paths:
- .karma/
- ./mocha.js
chrome: stable
sauce_connect: true
- stage: lint
script: npm start lint
# smoke tests use default npm.
- &smoke
stage: smoke
env: null
before_install: true
install: npm install --production
script: ./bin/mocha --no-config --reporter spec test/sanity/sanity.spec.js
cache:
directories:
- ~/.npm
- node_modules # npm install, unlike npm ci, doesn't wipe node_modules
- <<: *smoke
node_js: '10'
- <<: *smoke
node_js: '8'
- <<: *smoke
node_js: '6'
- stage: precache
script: true
notifications:
email: false
urls:
# for gitter mochajs/mocha
- secure: fUrHenYJs+pTuLtgBRoYyrlyfVekxaIGmLWq7bhUUqBj/7p5eCkQFn13LlPht0/4WWZOiPBcdTN7tKnz3Ho7ATUJhAchvOWDUgL5gtTvOzeCHbPuCvHz/VLK6hMoPdbLA45M864NDLotfHvyh62WgQaVw9iPc80eb+umaDPrYiU=
# for gitter mochajs/contributors
- secure: rGMGYWBaZgEa9i997jJHKzjI8WxECqLi6BqsMhvstDq9EeTeXkZFVfz4r6G3Xugsk3tFwb/pDpiYo1OK36kA5arUJTCia51u4Wn+c7lHKcpef/vXztoyucvw6/jXdVm/FQz1jztYYbqdyAOWC2BV8gYvg5F8TpK05UGCe5R0bRA=
on_success: change
on_failure: always