Skip to content

Commit

Permalink
build: restructure Travis CI build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Nov 4, 2018
1 parent 228b4ca commit 697ea95
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,25 @@ cache:
directories:
- node_modules
before_install:
# Skip updating shrinkwrap / lock
- "npm config set shrinkwrap false"
# Configure npm
- |
# Skip updating shrinkwrap / lock
npm config set shrinkwrap false
# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
- |
# Prune & rebuild node_modules
if [[ -d node_modules ]]; then
npm prune
npm rebuild
fi
script:
- |
# Run test script
npm test
after_script:
# Report coverage
- "test -d .nyc_output && npm install coveralls@2 && nyc report --reporter=text-lcov | coveralls"
- |
# Upload coverage to coveralls if exists
if [[ -d .nyc_output ]]; then
npm install --save-dev coveralls@2
nyc report --reporter=text-lcov | coveralls
fi

0 comments on commit 697ea95

Please sign in to comment.