mirror of
https://github.com/Swatinem/rust-cache.git
synced 2025-07-19 07:11:24 +03:00
Added prefix-key
cache-directories
and cache-targets
options (#85)
This commit is contained in:
12
dist/restore/index.js
vendored
12
dist/restore/index.js
vendored
@ -64545,7 +64545,7 @@ class CacheConfig {
|
||||
// Construct key prefix:
|
||||
// This uses either the `shared-key` input,
|
||||
// or the `key` input combined with the `job` key.
|
||||
let key = `v0-rust`;
|
||||
let key = lib_core.getInput("prefix-key");
|
||||
const sharedKey = lib_core.getInput("shared-key");
|
||||
if (sharedKey) {
|
||||
key += `-${sharedKey}`;
|
||||
@ -64630,7 +64630,15 @@ class CacheConfig {
|
||||
workspaces.push(new Workspace(root, target));
|
||||
}
|
||||
self.workspaces = workspaces;
|
||||
self.cachePaths = [config_CARGO_HOME, ...workspaces.map((ws) => ws.target)];
|
||||
self.cachePaths = [config_CARGO_HOME];
|
||||
const cacheTargets = lib_core.getInput("cache-targets").toLowerCase();
|
||||
if (cacheTargets === "true") {
|
||||
self.cachePaths.push(...workspaces.map((ws) => ws.target));
|
||||
}
|
||||
const cacheDirectories = lib_core.getInput("cache-directories");
|
||||
for (const dir of cacheDirectories.trim().split("\n")) {
|
||||
self.cachePaths.push(dir);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
printInfo() {
|
||||
|
12
dist/save/index.js
vendored
12
dist/save/index.js
vendored
@ -64545,7 +64545,7 @@ class CacheConfig {
|
||||
// Construct key prefix:
|
||||
// This uses either the `shared-key` input,
|
||||
// or the `key` input combined with the `job` key.
|
||||
let key = `v0-rust`;
|
||||
let key = core.getInput("prefix-key");
|
||||
const sharedKey = core.getInput("shared-key");
|
||||
if (sharedKey) {
|
||||
key += `-${sharedKey}`;
|
||||
@ -64630,7 +64630,15 @@ class CacheConfig {
|
||||
workspaces.push(new Workspace(root, target));
|
||||
}
|
||||
self.workspaces = workspaces;
|
||||
self.cachePaths = [CARGO_HOME, ...workspaces.map((ws) => ws.target)];
|
||||
self.cachePaths = [CARGO_HOME];
|
||||
const cacheTargets = core.getInput("cache-targets").toLowerCase();
|
||||
if (cacheTargets === "true") {
|
||||
self.cachePaths.push(...workspaces.map((ws) => ws.target));
|
||||
}
|
||||
const cacheDirectories = core.getInput("cache-directories");
|
||||
for (const dir of cacheDirectories.trim().split("\n")) {
|
||||
self.cachePaths.push(dir);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
printInfo() {
|
||||
|
Reference in New Issue
Block a user