diff --git a/.travis.yml b/.travis.yml index f914edbbb6..c32401ac61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ language: ruby sudo: false cache: - bundler - - directories: - - travis-phantomjs + - $(npm bin -g)/phantomjs bundler_args: --without development rvm: - "2.1.5" @@ -30,10 +29,9 @@ before_script: - cp config/application.yml.example config/application.yml - RAILS_ENV=test bundle exec rake db:create db:schema:load - - mkdir -p travis-phantomjs - - wget -nc https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 || true - - tar -xvf $PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2 -C $PWD/travis-phantomjs - - export PATH=$PWD/travis-phantomjs/phantomjs-2.1.1-linux-x86_64/bin:$PATH + # Only install PhantomJS if it is not already present (ie. cached) + - npm list -g phantomjs-prebuilt@~2.1.7 --depth=0 || npm install -g phantomjs-prebuilt@~2.1.7 + - export PATH=`npm bin -g`:$PATH - > if [ "$KARMA" = "true" ]; then