You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cache is hit but "bundle install" still try to install all dependency instead of just using them #201
However, although the cache is hit and restored to vendor/bundle, it seems that the required gems are still being installed. It slows down the CI and wastes a lot of resource. Here is the screenshot of the result, you can see bundle install installs the gems instead of just using them.
The final Post actions/cache@v1 reports the "Cache hit occurred".
Umm, setting a condition does not work. It gives a "Bundler::GemNotFound: Could not find minitest-5.14.0 in any of the sources" error now. It seems that the restored gems are not recognized at all. (Here is a sample error build for this case.)
Maybe it is related to the ruby (and gem) version? I am using rbenv on my local machine to manage ruby versions, and have a .ruby-version in the project root. I will try to dig it deeper to see how it affects.
Oh, it turned out to be my fault. I also skipped the bundle path setting. I have to split bundle config and bundle install to two steps to make it work. (Of course!)
The following steps work fine for now. I will keep an eye on it to see whether any unexpected behavior happens again.
Activity
mattt commentedon Mar 5, 2020
@onevcat Have you tried conditionalizing the bundle install step?
onevcat commentedon Mar 6, 2020
@mattt Thank you. Good idea! I will try it.
In fact, the
cacheaction works sometimes, even for the same cache key:Success case: https://github.com/onevcat/Kingfisher/runs/488869840?check_suite_focus=true
Failure case: https://github.com/onevcat/Kingfisher/runs/472663143?check_suite_focus=true
Both were restored from the same key, but have different behavior on
bundle install. It confuses me a bit.Anyway, I will add the condition checking to the install step and watch the result.
onevcat commentedon Mar 8, 2020
Umm, setting a condition does not work. It gives a "Bundler::GemNotFound: Could not find minitest-5.14.0 in any of the sources" error now. It seems that the restored gems are not recognized at all. (Here is a sample error build for this case.)
Maybe it is related to the ruby (and gem) version? I am using
rbenvon my local machine to manage ruby versions, and have a.ruby-versionin the project root. I will try to dig it deeper to see how it affects.onevcat commentedon Mar 8, 2020
Oh, it turned out to be my fault. I also skipped the bundle path setting. I have to split
bundle configandbundle installto two steps to make it work. (Of course!)The following steps work fine for now. I will keep an eye on it to see whether any unexpected behavior happens again.