Add more details to cache summary report

This commit is contained in:
Daz DeBoer 2022-06-02 22:39:55 -06:00
parent a9a5bcf180
commit 143774290e
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
3 changed files with 38 additions and 3 deletions

View file

@ -95,9 +95,11 @@ export class GradleStateCache {
async save(listener: CacheListener): Promise<void> {
const cacheKey = generateCacheKey(this.cacheName).key
const restoredCacheKey = core.getState(RESTORED_CACHE_KEY_KEY)
const entryListener = listener.entry(this.cacheDescription)
if (restoredCacheKey && cacheKey === restoredCacheKey) {
core.info(`Cache hit occurred on the cache key ${cacheKey}, not saving cache.`)
entryListener.markUnchanged('cache key not changed')
return
}
@ -110,7 +112,6 @@ export class GradleStateCache {
core.info(`Caching ${this.cacheDescription} with cache key: ${cacheKey}`)
const cachePath = this.getCachePath()
const entryListener = listener.entry(this.cacheDescription)
await saveCache(cachePath, cacheKey, entryListener)
return