From b161cb92f0e2f28d992f04f38fff204d84132c47 Mon Sep 17 00:00:00 2001 From: Jakub Pavlik Date: Fri, 14 May 2021 20:33:42 +0200 Subject: [PATCH] document cache-version --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 7a5cbfe..5c37478 100644 --- a/README.md +++ b/README.md @@ -180,6 +180,20 @@ When there is no lockfile, one is generated with `bundle lock`, which is the sam In other words, it works exactly like `bundle install`. The hash of the generated lockfile is then used for caching, which is the only correct approach. +#### Dealing with a corrupted cache + +In some rare scenarios (like using gems with C extensions whose functionality depends on libraries found on the system +at the time of the gem's build) it may be necessary to ignore contents of the cache and get and build all the gems anew. +In order to achieve this, set the `cache-version` option to any value other than `0` (or change it to a new unique value +if you have already used it before.) + +```yaml + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + cache-version: 1 +``` + #### Caching `bundle install` manually It is also possible to cache gems manually, but this is not recommended because it is verbose and *very difficult* to do correctly.