Skip to content

rake.yml installs the bundle twice: setup-ruby@v1 caches it, then the explicit bundle install runs against a fresh vendor/bundle path #234

Description

@kreinba

.github/workflows/rake.yml:13-19 calls ruby/setup-ruby@v1 with bundler-cache: true, then immediately re-points Bundler at a different directory and runs bundle install a second time:

- uses: ruby/setup-ruby@v1
  with:
    ruby-version: 3.4.9
    bundler-cache: true
- run: bundle config set --global path "$(pwd)/vendor/bundle"
- run: bundle install --no-color

bundler-cache: true already runs bundle install and saves a cache keyed on Gemfile.lock; the gems land at the default install path. The next step writes path "$(pwd)/vendor/bundle" into ~/.bundle/config, so Bundler stops reading the just-restored cache. The third step then installs every gem from scratch under vendor/bundle.

The cache restored by setup-ruby is dead weight: it lives at a location Bundler no longer consults, never shortens the build, and still costs network and storage on save and restore.

The fix is one of two single-line edits. Drop bundler-cache: true and keep the explicit vendor/bundle install, or drop the two follow-up lines and let setup-ruby install at its default cached path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions