forked from AutarkLabs/open-enterprise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
52 lines (42 loc) · 1.56 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# ensure running in a container for fast boot, travis has these requirements:
sudo: false
dist: "trusty"
# these are executed in order. each must pass for the next to be run
stages:
- precache # warm up cache for default Node.js version
- lint # lint code and docs
- test # all tests
# defaults
language: node_js
node_js: "node" # equivalent to stable, node 10
# `nvm install` happens before the cache is restored, which means
# we must install our own npm elsewhere (`~/cached-bins`)
before_install: |
# Evaluate with Bash if the npm in cached_bins path has NOT execution permission,
[[ ! -x ~/cached-bins/node_modules/.bin/npm ]] && {
# then we assume cache missed and install npm@latest and lerna
# caching feature creates `~/cached-bins` for us, the private:true is to avoid annoying npm warnings about package.json
cd ~/cached-bins && echo '{"private":true}' > package.json && npm install npm@latest lerna --no-package-lock
cd -
} || true
# avoids bugs around https://github.com/travis-ci/travis-ci/issues/5092
export PATH=~/cached-bins/node_modules/.bin:$PATH
install: npm run postinstall
cache:
directories:
- ~/.npm # cache npm's cache
- ~/cached-bins # cache latest npm and lerna
jobs:
include:
- script: travis_wait 60 npm run coverage
after_success: npm run coveralls
env: "COVERAGE=true"
- &node
script: npm run test
node_js: "lts/*"
- stage: lint
script: npm run lint
- stage: precache
script: true
notifications:
email: false