Skip to content

Commit 735e7a5

Browse files
committed
build: cache node_modules on Travis CI
1 parent 250514b commit 735e7a5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,17 @@ node_js:
1111
- "5.11"
1212
- "6.1"
1313
sudo: false
14+
cache:
15+
directories:
16+
- node_modules
1417
before_install:
1518
# Setup Node.js version-specific dependencies
1619
- "test $TRAVIS_NODE_VERSION != '0.6' || npm rm --save-dev istanbul"
1720
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
21+
22+
# Update Node.js modules
23+
- "test ! -d node_modules || npm prune"
24+
- "test ! -d node_modules || npm rebuild"
1825
script:
1926
# Run test script, depending on istanbul install
2027
- "test ! -z $(npm -ps ls istanbul) || npm test"

0 commit comments

Comments
 (0)