Skip to content

Commit e334884

Browse files
committed
Configure Travis CI to cache phantomjs binaries
This should speed up our CI builds and also save a lot of bandwidth for people providing phantomjs-prebuilt module. See also https://www.npmjs.com/package/phantomjs-prebuilt#continuous-integration
1 parent 68d55b5 commit e334884

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.travis.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,15 @@ node_js:
66
- "4"
77
- "6"
88

9+
# see https://www.npmjs.com/package/phantomjs-prebuilt#continuous-integration
10+
cache:
11+
directories:
12+
- travis_phantomjs
13+
before_install:
14+
# Upgrade PhantomJS to v2.1.1.
15+
- "export PHANTOMJS_VERSION=2.1.1"
16+
- "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH"
17+
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi"
18+
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then wget https://github.com/Medium/phantomjs/releases/download/v$PHANTOMJS_VERSION/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2; fi"
19+
- "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi"
20+
- "phantomjs --version"

0 commit comments

Comments
 (0)