Ruby Bundler Cache not found for input keys
See original GitHub issueFollowing the recommended setup for ruby bundler, the error “Cache not found for input keys” is always given, despite it saving correctly. I have tested multiple times with back to back runs, ensuring the previous run’s keys are matching, and that Gemfile.lock is not changing. Is there anything else I can use to debug?
name: 'Rspec'
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
services:
db:
image: postgres:11
ports: ['5432:5432']
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports: ['6379:6379']
options: --entrypoint redis-server
steps:
- uses: actions/checkout@v1
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.5.7
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
- uses: borales/actions-yarn@v2.0.0
with:
cmd: install
- name: Install Bundler
run: |
gem install bundler
- name: Install libpq-dev
run: |
sudo apt-get install libpq-dev
- name: Install Dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Prepare DB and run tests
run: |
bundle exec rails db:prepare
bundle exec rspec
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
when using bundler-cache: true, no gem versions in log #105
Use the working-directory input https://github.com/ruby/setup-ruby#working-directory if the gemfile is named Gemfile and just in a different ...
Read more >How to load Ruby gems from cache on Github Actions
You need to specify a directory path that will be cached. It's vendor/bundle in our case. You also generate a unique cache key...
Read more >cache-playwright-linux-1.20.0" on github actions ubuntu-latest
receiving "Cache not found for input keys: cache-playwright-linux-1.20. 0" on github actions ubuntu-latest - Stack Overflow. Stack Overflow for ...
Read more >bundle cache - Bundler
When using gems that have different packages for different platforms, Bundler supports caching of gems for other platforms where the Gemfile has been...
Read more >Caching dependencies in Github Actions - Sarunw
Ruby - Gem. - uses: actions/cache@v1 with: path: vendor/bundle key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }} restore-keys: |
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the example you gave, for a pull request, it should give read-write permissions to the feature branch (in this case it’s the pull ref, such as
refs/pull/180/merge
), read-only permission to thedevelop
branch, and read-only permission to the default branch (typicallymaster
).I’m only seeing records in the cache for the pull refs (
refs/pull/179/merge
,refs/pull/180/merge
, …). As such, they aren’t shared. Can you please check if you have any actions getting triggered from thedevelop
branch? If I had to guess, you probably need to also trigger the action on thepush
event.I don’t think we have any detailed public docs on how the scoping works. The overall mechanism is discussed on the cache docs page (search for “scope”). Edit: Also see the restrictions for accessing a cache section.
Thought I ran into the same problem here.
bundle install
ran every time and the cache was not used. But my problem was not the globbing, which I also changed from**/Gemfile.lock
toGemfile.lock
. But the problem was that the action never completed (due to failing tests) and therefore the cache was not saved (in apost
step)Would it be possible to save the cache before
post
like via trigger afterbundle install
?My action file contains: