-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's exactly cache-only
mode?
#23
Comments
Note: by default, when you provide The default behavior is:
The action does try to save/restore local build cache files, however, the cache has to be enabled by the developer (e.g. add The default behavior is:
Please check https://github.com/wzieba/BasicAndriodApp/runs/1166153438?check_suite_focus=true#step:8:6
It says that there's no files in the local build cache (I guess you didn't activate it), so there's nothing to save. That's why there's no "from cache" Note: the drawback of file-based build cache storage is that Action has to restore the cache fully. Does that make sense? |
Thanks for the explanation! But there's more... Just to make sure: when you write
do you mean
and it was just a typo? Or there's something about removing (updating?) cache?
Yes, that's true, I didn't enable it (by mistake). So I've pushed third build with This concluded me to the next question: is it intended to see a difference between I can see the difference in this sample build:
Does it mean that in the second scenario, action caches I can also see that the second scenario has
message, even after several runs, while the first scenario (action as wrapper) does not have this message (which is understandable as it'll use Additional log from the post phase of the cache action:
|
Well, it probably needs more explanation/better logging.
It is not restored because it is not stored (yet). Let me explain: Let us consider That is why I do the following:
In other words, if you run the cache action in your default branch at least once, then other branch-based (or PR-based) builds would be able to reuse that "default branch cache", so the amount of data stored "per-branch" or "per-PR" would be significantly less. AFAIK, you have never executed the cache action in the default branch, so the action skips File-based |
Thanks, it all makes sense! I was able to successfully use cache from the I will still prefer to delegate Gradle execution to action to have Gradle Remote cache with Github Actions caching API, but it's great to understand more from this action and the ideas behind it. As I don't have anything more to ask in this subject, I close the issue. Thanks a lot again, I hope this issue will be helpful for some future readers too. |
In the documentation I can see that there are two ways to use this action.
1. As wrapper around gradle command:
2. As a separate step
I can see in Sample integration that the first one is preferable but in Can I use the caching part of the action only there is mentioned
cache-only
mode. To what "cache" does thecache-only
refers to? Is it onlydependency cache
and notbuild cache
?I've done some tests in sample repo:
1. Wrapper around gradle command does perform
build cache
:55 actionable tasks: 13 executed, 42 from cache
2. Seperate step does not perform
build cache
55 actionable tasks: 55 executed
The text was updated successfully, but these errors were encountered: