mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Report sizes of cache entries
Using the patched version of @actions/cache, we now report the total size of cache entries restored/saved, as well as details of each one.
This commit is contained in:
@@ -67,10 +67,10 @@ export class GradleUserHomeCache extends AbstractCache {
|
||||
const cacheKey = fs.readFileSync(bundleMetaFile, 'utf-8').trim()
|
||||
listener.markRequested(cacheKey)
|
||||
|
||||
const restoredKey = await this.restoreCache([bundlePattern], cacheKey)
|
||||
if (restoredKey) {
|
||||
const restoredEntry = await this.restoreCache([bundlePattern], cacheKey)
|
||||
if (restoredEntry) {
|
||||
core.info(`Restored ${bundle} with key ${cacheKey} to ${bundlePattern}`)
|
||||
listener.markRestored(restoredKey)
|
||||
listener.markRestored(restoredEntry.key, restoredEntry.size)
|
||||
} else {
|
||||
core.info(`Did not restore ${bundle} with key ${cacheKey} to ${bundlePattern}`)
|
||||
tryDelete(bundleMetaFile)
|
||||
@@ -154,9 +154,11 @@ export class GradleUserHomeCache extends AbstractCache {
|
||||
this.debug(`No change to previously restored ${bundle}. Not caching.`)
|
||||
} else {
|
||||
core.info(`Caching ${bundle} with cache key: ${cacheKey}`)
|
||||
await this.saveCache([artifactPath], cacheKey)
|
||||
this.writeBundleMetaFile(bundleMetaFile, cacheKey)
|
||||
listener.markSaved(cacheKey)
|
||||
const savedEntry = await this.saveCache([artifactPath], cacheKey)
|
||||
if (savedEntry !== undefined) {
|
||||
this.writeBundleMetaFile(bundleMetaFile, cacheKey)
|
||||
listener.markSaved(savedEntry.key, savedEntry.size)
|
||||
}
|
||||
}
|
||||
|
||||
for (const file of bundleFiles) {
|
||||
|
||||
Reference in New Issue
Block a user