Skip to content

Feature request: don't cache specified gems and/or clear whole bundler cache #174

@igneus

Description

@igneus

Using setup-ruby with bundler-cache: true I now have in the cache a gem with native extensions, which are "broken" (successfully compiled, but against a set of C libraries other than I need). It seems to be impossible to replace contents of the cache. Even if Gemfile.lock changes, gems already present in the cache are reused and only missing ones installed, which is usually extremely useful, but not when you desperately need to rebuild the broken gem.

Would it be possible to add a new option, accepting a list of gems and excluding them from caching? E. g.

# ...
- uses: ruby/setup-ruby@v1
  with:
    ruby-version: 3.0.0
    bundler-cache: true
    #bundler-cache-exclude: # the new option I dream about
    #  - mysql2
    #  - nokogiri

    # EDIT: turns out that only simple string values are supported as action inputs
    bundler-cache-exclude: mysql2 nokogiri

For gems which are not self-contained, but depend on the build environment (like all gems with native extensions) this would occasionally be very useful.

If not, would it be possible to provide at least some mechanism for clearing the whole cache?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions