setup-ruby: Restoring bundler cache is not working in v1.144.1

Ensure the following before filing this issue

  • I verified it reproduces with the latest version with - uses: ruby/setup-ruby@v1 (see Versioning policy)

  • I tried to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for Downloading Ruby & Extracting Ruby), and it did not reproduce locally (if it does reproduce locally, it’s not a ruby/setup-ruby issue)

Are you running on a GitHub-hosted runner or a self-hosted runner?

GitHub-hosted runner

The workflow code or a link to the workflow file

name: CI
on: [push]
concurrency:
  group: ${{ github.ref }}
  cancel-in-progress: true

jobs:
  bundle:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v3

      - name: Install dependencies
        run: |
          sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends \
            libxmlsec1-dev libxmlsec1-openssl wkhtmltopdf

      - name: Github setup
        run: |
          git config --global url."https://${{secrets.GH_ACCESS_TOKEN}}:x-oauth-basic@github.com/".insteadOf "git@github.com:"

      - uses: ruby/setup-ruby@v1.144.1
        with:
          bundler-cache: true

Link to the log of a failed workflow job, or to a gist with the output

https://gist.github.com/jacob-carlborg-apoex/370a6197d4f1f5102f0a8c5e44235179

The command and output of the failing step

> bundle install
/opt/hostedtoolcache/Ruby/2.7.2/x64/bin/bundle config --local path /home/runner/work/foobar/foobar/vendor/bundle
/opt/hostedtoolcache/Ruby/2.7.2/x64/bin/bundle config --local deployment true
Cache key: setup-ruby-bundler-cache-v5-ubuntu-20.04-x64-ruby-2.7.2-wd-/home/runner/work/foobar/foobar-with--without--Gemfile.lock-74395cbea7219758bf34c731625de123b8704e40d1e7f64d3d455f933b051a3f
/opt/hostedtoolcache/Ruby/2.7.2/x64/bin/bundle install --jobs 4
Fetching gem metadata from https://rubygems.org/.......


### Any other notes?

Everything worked fine with `v1.144.0` but starting with `v1.144.1` `ruby/setup-ruby` fails to restore the bundler cache. There's no error message. The cache is just not restored.

I suspect the issue is this PR: https://github.com/ruby/setup-ruby/pull/482. It updated the NPM package `@actions/cache` from `3.0.6` to `3.2.1`. [3.2.1](https://github.com/actions/cache/releases/tag/v3.2.1) introduced this change: https://github.com/actions/cache/pull/1039, which was reverted in the next version [3.2.2](https://github.com/actions/cache/releases/tag/v3.2.2) in https://github.com/actions/cache/pull/1049.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 14
  • Comments: 18 (4 by maintainers)

Most upvoted comments

Should be fixed in https://github.com/ruby/setup-ruby/releases/tag/v1.144.2. Thank you @MSP-Greg for the PR and filing the upstream issue!

I’ve verified that the caches are not being used, looking thru the code now…

I’ve verified on one of our repos (private, sorry) that locking the action to v1.144.0 restores the cache and proceeds to run successfully.