Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

further build improvements #3315

Merged
merged 3 commits into from
Apr 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,21 @@ stages:
# defaults
language: node_js
node_js: '9'
env: PATH=~/npm/node_modules/.bin:$PATH
# `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
# this avoids compilation in most cases (where we don't need it)
install: npm ci --ignore-scripts
cache:
directories:
- ~/.npm
- node_modules
- ~/.npm # cache npm's cache
- ~/npm # cache latest npm

jobs:
include:
Expand All @@ -24,18 +35,12 @@ jobs:

- <<: *node
node_js: '6'
cache:
directories:
- node_modules

- <<: *node
node_js: '4'
cache:
directories:
- node_modules

- script: npm start test.bundle test.browser
before_script: mkdir -p .karma
install: npm ci # we need the native modules here
addons:
artifacts:
paths:
Expand All @@ -47,11 +52,18 @@ jobs:
- stage: lint
script: npm start lint

# smoke tests use default npm.
- &smoke
stage: smoke
env: NPM_CONFIG_PRODUCTION=1
env: null
before_install: true
install: npm install --production
# `--opts /dev/null` means "ignore test/mocha.opts"
script: ./bin/mocha --opts /dev/null --reporter spec test/sanity/sanity.spec.js
cache: false
cache:
directories:
- ~/.npm
- node_modules # npm install, unlike npm ci, doesn't wipe node_modules

- <<: *smoke
node_js: '8'
Expand Down