gradle / gradle-build-action

Execute your Gradle build and trigger dependency submission
https://github.com/marketplace/actions/gradle-build-action
MIT License
671 stars 97 forks source link

Cache miss on macOS and Windows #988

Closed JavierSegoviaCordoba closed 9 months ago

JavierSegoviaCordoba commented 9 months ago

I am triggering a matrix with the three OS. Calling it two times in a row with a workflow_dispatch should avoid rerunning all cacheable tasks in the second run, but this is only happening on Ubuntu.

Looks like there are some issues with the action related to the accessors (it shows Gradle 8.4, but the project is using Gradle 8.5).

Unhandled error in Gradle post-action - job will continue: Error: ENOENT: no such file or directory, realpath 'C:\Users\runneradmin\.gradle\caches\8.4\kotlin-dsl\accessors\2cef9241056ff6787ec530b1dbb398f1\classes\org\gradle\kotlin\dsl'
bigdaz commented 9 months ago

Thanks for the report @JavierSegoviaCordoba. The "Unhandled error" is very likely to be the problem, and this appears to be coming from the cache-cleanup part of the action. This problem during cache cleanup seems to be causing the rest of the post-action to abort, including writing the job summary. (Which means we can't see a caching summary like this for the MacOS/Windows run).

I suspect that you may have seen a similar issue with the build that should have written the data to the cache, but I'm unable to find that CI run. Can you repeat your experiment after deleting any GitHub Actions cache entries and share the links to both GitHub Actions runs (the one that writes the entries to cache and the one that should read them back).

In any case, the action should be more robust with respect to failures during cache-cleanup.

JavierSegoviaCordoba commented 9 months ago

I confirm it works. But I had to manually delete 30 cache files one by one via GitHub UI 😅

Having old caches that should be unnecessary is happening in all my repositories.

bigdaz commented 9 months ago

I confirm it works. But I had to manually delete 30 cache files one by one via GitHub UI

Thanks. I was actually hoping to confirm the error-on-store, but I guess whatever transient state caused the error is now gone. I should be able to make the cache-cleanup more robust anyway.

bigdaz commented 9 months ago

Closing this in preference of #990