add ability to version caches

This commit is contained in:
Arpad Borsos
2020-09-28 12:00:58 +02:00
parent cfcc373039
commit 1304a2ec8d
2 changed files with 11 additions and 7 deletions

View File

@@ -45,18 +45,22 @@ export async function getCaches(): Promise<Caches> {
if (targetKey) {
targetKey = `${targetKey}-`;
}
const registryIndex = `v0-registry-index`;
const registryCache = `v0-registry-cache`;
const target = `v0-target-${targetKey}${rustKey}`;
return {
index: {
name: "Registry Index",
path: paths.index,
key: "registry-index-XXX",
restoreKeys: ["registry-index"],
key: `${registryIndex}-`,
restoreKeys: [registryIndex],
},
cache: {
name: "Registry Cache",
path: paths.cache,
key: `registry-cache-${lockHash}`,
restoreKeys: ["registry-cache"],
key: `${registryCache}-${lockHash}`,
restoreKeys: [registryCache],
},
git: {
name: "Git Dependencies",
@@ -66,8 +70,8 @@ export async function getCaches(): Promise<Caches> {
target: {
name: "Target",
path: paths.target,
key: `target-${targetKey}${rustKey}-${lockHash}`,
restoreKeys: [`target-${targetKey}${rustKey}`],
key: `${target}-${lockHash}`,
restoreKeys: [target],
},
};
}