Skip to content

Commit

Permalink
Fix Bundler cache path for TravisCI builds (#516)
Browse files Browse the repository at this point in the history
The Bundle path wasn't set, so the TravisCI build cache did nothing,
cached nothing. Fix it by setting the `BUNDLE_PATH` environment variable
for all jobs in the build. Hopefully speeding up the jobs.
  • Loading branch information
tombruijn committed Apr 15, 2019
1 parent b5769b1 commit 501d4dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ branches:
language: ruby
cache:
directories:
- vendor/bundle
- "$TRAVIS_BUILD_DIR/vendor/cache"
env:
global:
- BUNDLE_PATH=$TRAVIS_BUILD_DIR/vendor/cache
- RUNNING_IN_CI=true
- RAILS_ENV=test
- JRUBY_OPTS=''
before_install:
- "./support/install_deps"
install: "./support/bundler_wrapper install --jobs=3 --retry=3"
install: "./support/bundler_wrapper install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-$TRAVIS_BUILD_DIR/vendor/cache}"
before_script:
- "./support/bundler_wrapper exec rake extension:install"
script: "./support/bundler_wrapper exec rake test"
Expand Down
5 changes: 3 additions & 2 deletions build_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ travis: # Default `.travis.yml` contents
language: ruby
cache:
directories:
- vendor/bundle
- "$TRAVIS_BUILD_DIR/vendor/cache"

env:
global:
- "BUNDLE_PATH=$TRAVIS_BUILD_DIR/vendor/cache"
- "RUNNING_IN_CI=true"
- "RAILS_ENV=test"
- "JRUBY_OPTS=''" # Workaround https://github.com/travis-ci/travis-ci/issues/6471

before_install:
- "./support/install_deps"
install: "./support/bundler_wrapper install --jobs=3 --retry=3"
install: "./support/bundler_wrapper install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-$TRAVIS_BUILD_DIR/vendor/cache}"
before_script:
- "./support/bundler_wrapper exec rake extension:install"
script: "./support/bundler_wrapper exec rake test"
Expand Down

0 comments on commit 501d4dd

Please sign in to comment.