3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2026-03-20 23:25:54 +00:00

merge the registry caches together

This commit is contained in:
Arpad Borsos 2020-10-03 18:10:54 +02:00
parent 2bcc375de8
commit f77cb1be47
6 changed files with 112 additions and 156 deletions

View file

@ -11,16 +11,16 @@ async function run() {
core.exportVariable("CARGO_INCREMENTAL", 0);
const caches = await getCaches();
for (const [type, { name, path, key, restoreKeys }] of Object.entries(caches)) {
for (const [type, { name, paths, key, restoreKeys }] of Object.entries(caches)) {
const start = Date.now();
core.startGroup(`Restoring ${name}`);
core.info(`Restoring to path "${path}".`);
core.info(`Restoring paths:\n ${paths.join("\n ")}.`);
core.info(`Using keys:\n ${[key, ...restoreKeys].join("\n ")}`);
try {
const restoreKey = await cache.restoreCache([path], key, restoreKeys);
const restoreKey = await cache.restoreCache(paths, key, restoreKeys);
if (restoreKey) {
core.info(`Restored from cache key "${restoreKey}".`);
core.saveState(type, restoreKey);
core.saveState(`CACHEKEY-${type}`, restoreKey);
} else {
core.info("No cache found.");
}