-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Does cache work? #142
Comments
how do you check if the cache is working or not? |
By running the same workflow multiple times, and then checking it runs from scratch or if skips compiling unchanged dependencies. |
see https://github.com/vixalien/muzika/actions for the runs |
Rerunning the workflow won't make the caching work, you have to push a new commit |
I know. which is why I'm pushing new commits to test, to no avail. |
It looks like it's working: https://github.com/vixalien/muzika/actions/caches |
It's caching yes, but it doesn't seem to be restoring the cache.. |
the build logs say |
I don't recall exactly how this action organizes caches, but they may be tied to the PR branch. I would recommend you get a build running on your main branch, then see if a PR will pick-up the cache. You should also know that Incidentally, you probably want to move |
alright! I'll merge the PR and report back when the main branch has triggered some CI builds.
While I'm not sure about what that means exactly, I think I've set it up correctly... This is because there's a libadwaita module which has other modules as children (gtk, sassc etc..) Do you know how I could fix it? |
Just think of it like a project, building each dependency before the module that depends on it. So you want:
Because |
I've had a couple of CI runs, and still the cache doesn't seem to be working |
It seems like your cache key is changing, even between runs. In It looks like you are using Also note your most recent change modified the |
by "default cache-key" do you mean that I should omit it, or set it to |
By "default" I mean don't set it all, and let the GitHub action pick it for you. It will use a hash of the flatpak manifest, and only create a new cache when that file changes. |
alright. I've implemented your recommendations and I'll update after a few CI runs |
I removed the cache-key, and the behavior still persists... |
Both these runs (
This implies that the cache is being saved, but not restored for some reason. I believe the code is correct from what I can see (here for reference). I'd say you might have found a confirmed bug, but I'm not sure because it doesn't print the cache key or the cache hit if it fails. Sorry, I've reached the end of my best guesses what's happening here :/ |
I see that this can happen when cache fails to be committed. will update this after a few other CI runs to see if it's indeed a bug |
okay I found the culprint. for some reason I had the following in the workflow file. permissions:
contents: read I reset the file using the template from the page and now I can see the cache gets saved correctly. However, it doesn't get restored still. I omitted the Also interesting is that all the examples on the github marketplace page use |
solved by using and (I'm not sure which one of the two solved it, but I'm too tired to find out) |
I can confirm this only happens when you use I'm reopening this since it's indeed an issue that prevents upgrading. I can only confirm it works on |
I encountered the same problem, and in order to avoid the impact of Run on default branch:
|
so your workaround will only start working from the 4th run? |
@vixalien That's not a solution, it's the step I tried to reproduce the problem. You will find that the incorrect cache content was restored for the fourth time. Based on the above operation, I guess the problem may have occurred during the upload cache. I am now using a simpler way to make the cache effective,set cache to false in - name: Cache
id: cache
uses: actions/cache@v3
with:
path: .flatpak-builder
key: wiliwili-flatpak-${{ matrix.driver }}-${{ hashFiles('.flatpak-manifest.yml') }}-${{ matrix.arch }} For my project, the cache size has decreased from 350M to 140M, but it has no impact on compilation, and the cache has also taken effect. |
does this mean cache works correctly? as in does the compiler use the cache? |
Here is the log:
When cache hits, no dependencies need to be recompiled. I haven't paid much attention to the behavior of caching before. It seems that the original cache not only avoids the compilation of dependencies, but also reduces the compilation of the main program. And manually using cache action will completely recompile the main program every time, because my program compiles slowly, so I don't want to spend time on it anymore. Manually using cache action is already enough for me to use. |
I figured this out, The reason for this issue is an error in the upstream. It should be resolved when this PR is merged: Before that, you can temporarily use: |
This was resolved thanks to @xfangfang. I will roll out a release some time this week and backport the fixes |
I completely missed this. Thanks everyone!! |
I'm trying to setup CI for github.com/vixalien/muzika
but it seems like the cache doesn't work correctly and GTK ends up being recompiled again.. Does one need to use https://github.com/marketplace/actions/cache?
Here's my workflow file:
The text was updated successfully, but these errors were encountered: