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
@ -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