Add restore cache.

This commit is contained in:
Miles Johnson 2023-04-17 14:02:21 -07:00
parent 7b19c2c567
commit 8cbd5dda6b
3 changed files with 54 additions and 18 deletions

View file

@ -3,3 +3,11 @@ import path from 'path';
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
export const CARGO_HOME = process.env.CARGO_HOME || path.join(os.homedir(), '.cargo');
export function getPrimaryCacheKey(): string {
return `setup-rustcargo-${process.platform}`;
}
export function getPathsToCache(): string[] {
return [path.join(CARGO_HOME, 'registry')];
}