3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-04-29 14:45:53 +00:00

key target by job id automatically

This commit is contained in:
Arpad Borsos 2020-10-03 17:33:09 +02:00
parent bd4d2a7017
commit 2bcc375de8
4 changed files with 20 additions and 15 deletions

View file

@ -10,7 +10,7 @@ const home = os.homedir();
export const paths = {
index: path.join(home, ".cargo/registry/index"),
cache: path.join(home, ".cargo/registry/cache"),
git: path.join(home, ".cargo/git/db"),
// git: path.join(home, ".cargo/git/db"),
target: "target",
};
@ -45,6 +45,10 @@ export async function getCaches(): Promise<Caches> {
if (targetKey) {
targetKey = `${targetKey}-`;
}
const job = process.env.GITHUB_JOB;
if (job) {
targetKey = `${job}-${targetKey}`;
}
const registryIndex = `v0-registry-index`;
const registryCache = `v0-registry-cache`;