mirror of
https://github.com/Swatinem/rust-cache.git
synced 2025-08-14 20:55:13 +00:00
revert dist change
This commit is contained in:
parent
88f224fae6
commit
f9263a51b3
45
dist/restore/index.js
vendored
45
dist/restore/index.js
vendored
@ -64603,6 +64603,25 @@ class CacheConfig {
|
|||||||
// might create/overwrite lockfiles.
|
// might create/overwrite lockfiles.
|
||||||
let lockHash = lib_core.getState(STATE_LOCKFILE_HASH);
|
let lockHash = lib_core.getState(STATE_LOCKFILE_HASH);
|
||||||
let keyFiles = JSON.parse(lib_core.getState(STATE_LOCKFILES) || "[]");
|
let keyFiles = JSON.parse(lib_core.getState(STATE_LOCKFILES) || "[]");
|
||||||
|
if (!lockHash) {
|
||||||
|
const globber = await glob.create("**/Cargo.toml\n**/Cargo.lock\nrust-toolchain\nrust-toolchain.toml", {
|
||||||
|
followSymbolicLinks: false,
|
||||||
|
});
|
||||||
|
keyFiles = await globber.glob();
|
||||||
|
keyFiles.sort((a, b) => a.localeCompare(b));
|
||||||
|
hasher = external_crypto_default().createHash("sha1");
|
||||||
|
for (const file of keyFiles) {
|
||||||
|
for await (const chunk of external_fs_default().createReadStream(file)) {
|
||||||
|
hasher.update(chunk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lockHash = hasher.digest("hex");
|
||||||
|
lib_core.saveState(STATE_LOCKFILE_HASH, lockHash);
|
||||||
|
lib_core.saveState(STATE_LOCKFILES, JSON.stringify(keyFiles));
|
||||||
|
}
|
||||||
|
self.keyFiles = keyFiles;
|
||||||
|
key += `-${lockHash}`;
|
||||||
|
self.cacheKey = key;
|
||||||
// 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.
|
||||||
const workspaces = [];
|
const workspaces = [];
|
||||||
@ -64614,32 +64633,6 @@ class CacheConfig {
|
|||||||
workspaces.push(new Workspace(root, target));
|
workspaces.push(new Workspace(root, target));
|
||||||
}
|
}
|
||||||
self.workspaces = workspaces;
|
self.workspaces = workspaces;
|
||||||
if (!lockHash) {
|
|
||||||
hasher = external_crypto_default().createHash("sha1");
|
|
||||||
async function globHash(pattern) {
|
|
||||||
const globber = await glob.create(pattern, {
|
|
||||||
followSymbolicLinks: false,
|
|
||||||
});
|
|
||||||
keyFiles = keyFiles.concat(await globber.glob());
|
|
||||||
keyFiles.sort((a, b) => a.localeCompare(b));
|
|
||||||
for (const file of keyFiles) {
|
|
||||||
for await (const chunk of external_fs_default().createReadStream(file)) {
|
|
||||||
hasher.update(chunk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await globHash("rust-toolchain\nrust-toolchain.toml");
|
|
||||||
for (const workspace of workspaces) {
|
|
||||||
const root = workspace.root;
|
|
||||||
await globHash(`${root}/**/Cargo.toml\n${root}/**/Cargo.lock`);
|
|
||||||
}
|
|
||||||
lockHash = hasher.digest("hex");
|
|
||||||
lib_core.saveState(STATE_LOCKFILE_HASH, lockHash);
|
|
||||||
lib_core.saveState(STATE_LOCKFILES, JSON.stringify(keyFiles));
|
|
||||||
}
|
|
||||||
self.keyFiles = keyFiles;
|
|
||||||
key += `-${lockHash}`;
|
|
||||||
self.cacheKey = key;
|
|
||||||
self.cachePaths = [config_CARGO_HOME];
|
self.cachePaths = [config_CARGO_HOME];
|
||||||
const cacheTargets = lib_core.getInput("cache-targets").toLowerCase();
|
const cacheTargets = lib_core.getInput("cache-targets").toLowerCase();
|
||||||
if (cacheTargets === "true") {
|
if (cacheTargets === "true") {
|
||||||
|
45
dist/save/index.js
vendored
45
dist/save/index.js
vendored
@ -64603,6 +64603,25 @@ 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 = JSON.parse(core.getState(STATE_LOCKFILES) || "[]");
|
let keyFiles = JSON.parse(core.getState(STATE_LOCKFILES) || "[]");
|
||||||
|
if (!lockHash) {
|
||||||
|
const globber = await glob.create("**/Cargo.toml\n**/Cargo.lock\nrust-toolchain\nrust-toolchain.toml", {
|
||||||
|
followSymbolicLinks: false,
|
||||||
|
});
|
||||||
|
keyFiles = await globber.glob();
|
||||||
|
keyFiles.sort((a, b) => a.localeCompare(b));
|
||||||
|
hasher = external_crypto_default().createHash("sha1");
|
||||||
|
for (const file of keyFiles) {
|
||||||
|
for await (const chunk of external_fs_default().createReadStream(file)) {
|
||||||
|
hasher.update(chunk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lockHash = hasher.digest("hex");
|
||||||
|
core.saveState(STATE_LOCKFILE_HASH, lockHash);
|
||||||
|
core.saveState(STATE_LOCKFILES, JSON.stringify(keyFiles));
|
||||||
|
}
|
||||||
|
self.keyFiles = keyFiles;
|
||||||
|
key += `-${lockHash}`;
|
||||||
|
self.cacheKey = key;
|
||||||
// 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.
|
||||||
const workspaces = [];
|
const workspaces = [];
|
||||||
@ -64614,32 +64633,6 @@ class CacheConfig {
|
|||||||
workspaces.push(new Workspace(root, target));
|
workspaces.push(new Workspace(root, target));
|
||||||
}
|
}
|
||||||
self.workspaces = workspaces;
|
self.workspaces = workspaces;
|
||||||
if (!lockHash) {
|
|
||||||
hasher = external_crypto_default().createHash("sha1");
|
|
||||||
async function globHash(pattern) {
|
|
||||||
const globber = await glob.create(pattern, {
|
|
||||||
followSymbolicLinks: false,
|
|
||||||
});
|
|
||||||
keyFiles = keyFiles.concat(await globber.glob());
|
|
||||||
keyFiles.sort((a, b) => a.localeCompare(b));
|
|
||||||
for (const file of keyFiles) {
|
|
||||||
for await (const chunk of external_fs_default().createReadStream(file)) {
|
|
||||||
hasher.update(chunk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await globHash("rust-toolchain\nrust-toolchain.toml");
|
|
||||||
for (const workspace of workspaces) {
|
|
||||||
const root = workspace.root;
|
|
||||||
await globHash(`${root}/**/Cargo.toml\n${root}/**/Cargo.lock`);
|
|
||||||
}
|
|
||||||
lockHash = hasher.digest("hex");
|
|
||||||
core.saveState(STATE_LOCKFILE_HASH, lockHash);
|
|
||||||
core.saveState(STATE_LOCKFILES, JSON.stringify(keyFiles));
|
|
||||||
}
|
|
||||||
self.keyFiles = keyFiles;
|
|
||||||
key += `-${lockHash}`;
|
|
||||||
self.cacheKey = key;
|
|
||||||
self.cachePaths = [CARGO_HOME];
|
self.cachePaths = [CARGO_HOME];
|
||||||
const cacheTargets = core.getInput("cache-targets").toLowerCase();
|
const cacheTargets = core.getInput("cache-targets").toLowerCase();
|
||||||
if (cacheTargets === "true") {
|
if (cacheTargets === "true") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user