mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-07 16:56:12 +02:00
Improved cache reporting
- Fix count of saved entries - Catch and report errors on save and restore - Correctly report entries that are never requested
This commit is contained in:
parent
cbebff71e9
commit
b49446f8e1
4 changed files with 24 additions and 10 deletions
|
@ -154,6 +154,7 @@ export async function restoreCache(
|
|||
}
|
||||
return restoredEntry
|
||||
} catch (error) {
|
||||
listener.markNotRestored((error as Error).message)
|
||||
handleCacheFailure(error, `Failed to restore ${cacheKey}`)
|
||||
return undefined
|
||||
}
|
||||
|
@ -166,6 +167,8 @@ export async function saveCache(cachePath: string[], cacheKey: string, listener:
|
|||
} catch (error) {
|
||||
if (error instanceof cache.ReserveCacheError) {
|
||||
listener.markAlreadyExists(cacheKey)
|
||||
} else {
|
||||
listener.markNotSaved((error as Error).message)
|
||||
}
|
||||
handleCacheFailure(error, `Failed to save cache entry with path '${cachePath}' and key: ${cacheKey}`)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue