mirror of
https://github.com/Swatinem/rust-cache.git
synced 2025-08-14 20:55:13 +00:00
also search for rust-toolchain files on each workspace
This commit is contained in:
parent
4b699461db
commit
df5298f6e0
@ -36,7 +36,7 @@ export class CacheConfig {
|
|||||||
/** The files considered for the cache key */
|
/** The files considered for the cache key */
|
||||||
private keyFiles: Array<string> = [];
|
private keyFiles: Array<string> = [];
|
||||||
|
|
||||||
private constructor() { }
|
private constructor() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a [`CacheConfig`] with all the paths and keys.
|
* Constructs a [`CacheConfig`] with all the paths and keys.
|
||||||
@ -116,6 +116,7 @@ export class CacheConfig {
|
|||||||
// might create/overwrite lockfiles.
|
// might create/overwrite lockfiles.
|
||||||
|
|
||||||
let lockHash = core.getState(STATE_LOCKFILE_HASH);
|
let lockHash = core.getState(STATE_LOCKFILE_HASH);
|
||||||
|
let keyFiles: Array<string> = JSON.parse(core.getState(STATE_LOCKFILES) || "[]");
|
||||||
|
|
||||||
// Constructs the workspace config and paths to restore:
|
// Constructs the workspace config and paths to restore:
|
||||||
// The workspaces are given using a `$workspace -> $target` syntax.
|
// The workspaces are given using a `$workspace -> $target` syntax.
|
||||||
@ -130,8 +131,6 @@ export class CacheConfig {
|
|||||||
}
|
}
|
||||||
self.workspaces = workspaces;
|
self.workspaces = workspaces;
|
||||||
|
|
||||||
let keyFiles: Array<string> = JSON.parse(core.getState(STATE_LOCKFILES) || "[]");
|
|
||||||
|
|
||||||
if (!lockHash) {
|
if (!lockHash) {
|
||||||
hasher = crypto.createHash("sha1");
|
hasher = crypto.createHash("sha1");
|
||||||
|
|
||||||
@ -145,7 +144,7 @@ export class CacheConfig {
|
|||||||
keyFiles = keyFiles.concat(await globHash("rust-toolchain\nrust-toolchain.toml"));
|
keyFiles = keyFiles.concat(await globHash("rust-toolchain\nrust-toolchain.toml"));
|
||||||
for (const workspace of workspaces) {
|
for (const workspace of workspaces) {
|
||||||
const root = workspace.root;
|
const root = workspace.root;
|
||||||
keyFiles = keyFiles.concat(await globHash(`${root}/**/Cargo.toml\n${root}/**/Cargo.lock`));
|
keyFiles = keyFiles.concat(await globHash(`${root}/**/Cargo.toml\n${root}/**/Cargo.lock\n${root}/**/rust-toolchain\n${root}/**/rust-toolchain.toml`));
|
||||||
}
|
}
|
||||||
|
|
||||||
keyFiles.sort((a, b) => a.localeCompare(b));
|
keyFiles.sort((a, b) => a.localeCompare(b));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user