Add new input.

This commit is contained in:
Miles Johnson 2024-05-03 11:37:20 -07:00
parent e6a829b5bd
commit 6a8624d80a
5 changed files with 23 additions and 8 deletions

View file

@ -18,12 +18,19 @@ export function getCacheTarget(): string {
return core.getInput('cache-target') || 'debug';
}
export function getTargetPaths(): string[] {
const profile = getCacheTarget();
const dirs = core.getInput('target-dirs', { required: true }).split(',');
return dirs.filter((dir) => dir.trim()).map((dir) => path.join(WORKSPACE_ROOT, dir, profile));
}
export function getCachePaths(): string[] {
return [
// ~/.cargo/registry
path.join(CARGO_HOME, 'registry'),
// /workspace/target/debug
path.join(WORKSPACE_ROOT, 'target', getCacheTarget()),
...getTargetPaths(),
];
}