Skip to content

Commit 21351ec

Browse files
authored
More details about BUNDLE_GEMFILE
1 parent 4d7e038 commit 21351ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,13 @@ This caching speeds up installing gems significantly and avoids too many request
136136
It needs a `Gemfile` (or `$BUNDLE_GEMFILE` or `gems.rb`) under the [`working-directory`](#working-directory).
137137
If there is a `Gemfile.lock` (or `$BUNDLE_GEMFILE.lock` or `gems.locked`), `bundle config --local deployment true` is used.
138138

139-
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:
139+
To use a `Gemfile` which is not at the root or has a different name, set `BUNDLE_GEMFILE` in the `env` at the job level, so it is set for all steps:
140140
```yaml
141-
142141
jobs:
143142
test:
144143
runs-on: ubuntu-latest
145144
env:
146-
BUNDLE_GEMFILE: subdir/Gemfile
145+
BUNDLE_GEMFILE: subdir/mygemfile
147146
steps:
148147
- uses: actions/checkout@v2
149148
- uses: ruby/setup-ruby@v1
@@ -152,6 +151,7 @@ jobs:
152151
bundler-cache: true
153152
- run: bundle exec rake
154153
```
154+
Of course you can also use a matrix of gemfiles if you need to test multiple gemfiles.
155155

156156
To perform caching, this action will use `bundle config --local path vendor/bundle`.
157157
Therefore, the Bundler `path` should not be changed in your workflow for the cache to work (no `bundle config path`).

0 commit comments

Comments
 (0)