From f8713586884ca2a109ea2e4df63e8ba39c9d520e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Wed, 22 Feb 2017 15:19:55 +0100 Subject: [PATCH] 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 --- .travis.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index 68e314e2..044cdb6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,3 +6,15 @@ node_js: - "7" after_success: npm run coverage +# see https://www.npmjs.com/package/phantomjs-prebuilt#continuous-integration +cache: + directories: + - travis_phantomjs +before_install: + # Upgrade PhantomJS to v2.1.1. + - "export PHANTOMJS_VERSION=2.1.1" + - "export PATH=$PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin:$PATH" + - "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then rm -rf $PWD/travis_phantomjs; mkdir -p $PWD/travis_phantomjs; fi" + - "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" + - "if [ $(phantomjs --version) != $PHANTOMJS_VERSION ]; then tar -xvf $PWD/travis_phantomjs/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C $PWD/travis_phantomjs; fi" + - "phantomjs --version"