mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-13 14:34:21 +02:00
Show how to set BUNDLE_GEMFILE in the README
This commit is contained in:
@@ -136,6 +136,23 @@ This caching speeds up installing gems significantly and avoids too many request
|
||||
It needs a `Gemfile` (or `$BUNDLE_GEMFILE` or `gems.rb`) under the [`working-directory`](#working-directory).
|
||||
If there is a `Gemfile.lock` (or `$BUNDLE_GEMFILE.lock` or `gems.locked`), `bundle config --local deployment true` is used.
|
||||
|
||||
To use a `Gemfile` which is not at the root, set `BUNDLE_GEMFILE` in the `env` at the job level, so it is set for all steps:
|
||||
```yaml
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
BUNDLE_GEMFILE: subdir/Gemfile
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
bundler-cache: true
|
||||
- run: bundle exec rake
|
||||
```
|
||||
|
||||
To perform caching, this action will use `bundle config --local path vendor/bundle`.
|
||||
Therefore, the Bundler `path` should not be changed in your workflow for the cache to work (no `bundle config path`).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user