Skip to content

Commit

Permalink
build: cache node_modules on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Sep 23, 2018
1 parent 4388690 commit d3f4796
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ node_js:
- "9.11"
- "10.11"
sudo: false
cache:
directories:
- node_modules
before_install:
# Skip updating shrinkwrap / lock
- "npm config set shrinkwrap false"
Expand All @@ -22,6 +25,9 @@ before_install:
# Setup Node.js version-specific dependencies
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 6 || npm rm --save-dev $(grep -E '\"eslint\\S*\"' package.json | cut -d'\"' -f2)"
# Update Node.js modules
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
script:
# Run test script, depending on istanbul install
- "test ! -z $(npm -ps ls istanbul) || npm test"
Expand Down

0 comments on commit d3f4796

Please sign in to comment.