3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-11-08 08:25:05 +00:00

improve logging

This commit is contained in:
Arpad Borsos 2020-09-28 11:54:24 +02:00
parent 8902a8fc6c
commit cfcc373039
3 changed files with 32 additions and 14 deletions

View file

@ -28,16 +28,16 @@ async function run() {
delete (caches as any).cache;
}
for (const [name, { path, key }] of Object.entries(caches)) {
if (core.getState(name) === key) {
core.info(`Cache for "${path}" up-to-date.`);
for (const [type, { name, path, key }] of Object.entries(caches)) {
if (core.getState(type) === key) {
core.info(`${name} up-to-date.`);
continue;
}
try {
core.startGroup(`Saving "${path}" to cache key "${key}"`);
if (await cache.saveCache([path], key)) {
core.info(`Saved "${path}" to cache key "${key}".`);
}
core.startGroup(`Saving ${name}`);
core.info(`Saving path "${path}".`);
core.info(`Using key "${key}".`);
await cache.saveCache([path], key);
} catch (e) {
core.info(`[warning] ${e.message}`);
} finally {