Last active
April 14, 2019 07:52
-
-
Save perlun/a20924957203d4fc202e9b6523d79598 to your computer and use it in GitHub Desktop.
Super-fast Travis JRuby install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Background: JRuby installs on Travis is painfully slow. The version which is preinstalled is very old. Here are some GitHub | |
# issues about it: | |
# | |
# https://github.com/travis-ci/docs-travis-ci-com/pull/743 | |
# https://github.com/travis-ci/travis-rubies/issues/22 | |
# https://github.com/travis-ci/travis-ci/issues/6892 | |
# https://github.com/travis-ci/packer-templates/issues/391 | |
# | |
# Since the upstream issue is still unresolved, and a JRuby install takes anywhere from 100 to 200 seconds (!), we decided to | |
# implement this workaround. With this in place, the JRuby install takes about 10 seconds. | |
sudo: false | |
language: ruby | |
# Dummy version to avoid wasting time on RVM installs. | |
rvm: 1.9.3 | |
before_install: | |
- if [ ! -d "$HOME/jruby-bin" ]; then mkdir -p ~/jruby-bin && pushd ~/jruby-bin && curl -o- -L https://s3.amazonaws.com/jruby.org/downloads/9.1.8.0/jruby-bin-9.1.8.0.tar.gz | tar xzf - --strip-components=1 && popd ; fi | |
- export PATH="$HOME/jruby-bin/bin:$PATH" | |
- gem install bundler | |
# The rest of your .travis.yml content goes here (run specs, build app etc). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Downside: breaks caching of Bundler packages (seems to use the Ruby version given inFixed in the latest commit..rvm
to perform the caching).