-
Notifications
You must be signed in to change notification settings - Fork 185
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
GitHub: Add cache-dependency-path #3622
Conversation
I noticed that on my PR no caching is taking place.
Looking into this one. Sorry for taking so long. |
So, I did a small investigation and learned that the cache is working as intended. With the intention itself being somewhat weird for our use case... And sometimes outright not working at all... Here's what I mean. If you look at your example PR, you will notice that cache failed for the first check run (and for some reason for the second run too) but succeeded on the subsequent ones. At least for some tasks. It's just weird by itself. What you're proposing is to limit the change check to only one file instead of Here's the part of the Action code that is impacted by this property: https://github.com/actions/setup-java/blob/7a6d8a8234af8eb26422e24e3006232cccaa061b/src/cache.ts#L88 const pattern = cacheDependencyPath
? cacheDependencyPath.trim().split('\n')
: packageManager.pattern; Where {
id: 'maven',
path: [join(os.homedir(), '.m2', 'repository')],
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
pattern: ['**/pom.xml']
}, TLDR: caching is borked by itself, we'll need to investigate it a bit more before we try any hacks. |
Hi @Net-burst No worries 😄 Thanks for taking the time.
If this is the order, than this possible. The cache is populated for the first time and could not be available due to eventually consistency or tasks running in parallel for the some tasks.
Using a pattern I wouldn't say that limiting the cache key to a single |
Yeah, looks like you are right. That thing is asynchronous so hashing will happen in any order... And I have no knowledge about how crypto is implemented in Node and whether ordering matters... Let's merge your workaround and see whether this will solve the caching. Although during the investigation I learned that cache is per-branch. Which means that every first run will be with cold caches... Which is meh, but it's better than nothing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I guess this is not entirely correct. This is from the github caching docs
So pull requests should use the cache from the |
I noticed that on my PR no caching is taking place.
🔧 Type of changes
✨ What's the context?
https://github.com/prebid/prebid-server-java/pull/3613/checks shows
🧠 Rationale behind the change
Make PR tests faster