mirror of
https://gitea.com/actions/cache.git
synced 2024-11-25 22:02:28 +08:00
Merge pull request #514 from eregon/recommend-setup-ruby-bundler-cache
Recommend ruby/setup-ruby's bundler-cache: true option
This commit is contained in:
commit
56a8a2f775
23
examples.md
23
examples.md
|
@ -468,21 +468,18 @@ Replace `~/.local/share/renv` with the correct `path` if not using Ubuntu.
|
||||||
|
|
||||||
## Ruby - Bundler
|
## Ruby - Bundler
|
||||||
|
|
||||||
```yaml
|
Caching gems with Bundler correctly is not trivial and just using `actions/cache`
|
||||||
- uses: actions/cache@v2
|
is [not enough](https://github.com/ruby/setup-ruby#caching-bundle-install-manually).
|
||||||
with:
|
|
||||||
path: vendor/bundle
|
Instead, it is recommended to use `ruby/setup-ruby`'s
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
[`bundler-cache: true` option](https://github.com/ruby/setup-ruby#caching-bundle-install-automatically)
|
||||||
restore-keys: |
|
whenever possible:
|
||||||
${{ runner.os }}-gems-
|
|
||||||
```
|
|
||||||
When dependencies are installed later in the workflow, we must specify the same path for the bundler.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Bundle install
|
- uses: ruby/setup-ruby@v1
|
||||||
run: |
|
with:
|
||||||
bundle config path vendor/bundle
|
ruby-version: ...
|
||||||
bundle install --jobs 4 --retry 3
|
bundler-cache: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Rust - Cargo
|
## Rust - Cargo
|
||||||
|
|
Loading…
Reference in New Issue
Block a user