@@ -86684,10 +86684,10 @@ class Workspace {
8668486684 return packages;
8668586685 }
8668686686 async getPackagesOutsideWorkspaceRoot() {
86687- return await this.getPackages(pkg => !pkg.manifest_path.startsWith(this.root));
86687+ return await this.getPackages(( pkg) => !pkg.manifest_path.startsWith(this.root));
8668886688 }
8668986689 async getWorkspaceMembers() {
86690- return await this.getPackages(_ => true, "--no-deps");
86690+ return await this.getPackages((_) => true, "--no-deps");
8669186691 }
8669286692}
8669386693
@@ -86811,7 +86811,7 @@ class CacheConfig {
8681186811 const root = workspace.root;
8681286812 keyFiles.push(...(await globFiles(`${root}/**/.cargo/config.toml\n${root}/**/rust-toolchain\n${root}/**/rust-toolchain.toml`)));
8681386813 const workspaceMembers = await workspace.getWorkspaceMembers();
86814- const cargo_manifests = sort_and_uniq(workspaceMembers.map(member => external_path_default().join(member.path, "Cargo.toml")));
86814+ const cargo_manifests = sort_and_uniq(workspaceMembers.map(( member) => external_path_default().join(member.path, "Cargo.toml")));
8681586815 for (const cargo_manifest of cargo_manifests) {
8681686816 try {
8681786817 const content = await promises_default().readFile(cargo_manifest, { encoding: "utf8" });
@@ -86847,7 +86847,8 @@ class CacheConfig {
8684786847 hasher.update(JSON.stringify(parsed));
8684886848 parsedKeyFiles.push(cargo_manifest);
8684986849 }
86850- catch (e) { // Fallback to caching them as regular file
86850+ catch (e) {
86851+ // Fallback to caching them as regular file
8685186852 lib_core.warning(`Error parsing Cargo.toml manifest, fallback to caching entire file: ${e}`);
8685286853 keyFiles.push(cargo_manifest);
8685386854 }
@@ -86860,7 +86861,7 @@ class CacheConfig {
8686086861 if ((parsed.version !== 3 && parsed.version !== 4) || !("package" in parsed)) {
8686186862 // Fallback to caching them as regular file since this action
8686286863 // can only handle Cargo.lock format version 3
86863- lib_core.warning(' Unsupported Cargo.lock format, fallback to caching entire file' );
86864+ lib_core.warning(" Unsupported Cargo.lock format, fallback to caching entire file" );
8686486865 keyFiles.push(cargo_lock);
8686586866 continue;
8686686867 }
@@ -86870,7 +86871,8 @@ class CacheConfig {
8687086871 hasher.update(JSON.stringify(packages));
8687186872 parsedKeyFiles.push(cargo_lock);
8687286873 }
86873- catch (e) { // Fallback to caching them as regular file
86874+ catch (e) {
86875+ // Fallback to caching them as regular file
8687486876 lib_core.warning(`Error parsing Cargo.lock manifest, fallback to caching entire file: ${e}`);
8687586877 keyFiles.push(cargo_lock);
8687686878 }
@@ -86887,12 +86889,14 @@ class CacheConfig {
8688786889 self.keyFiles = sort_and_uniq(keyFiles);
8688886890 key += `-${lockHash}`;
8688986891 self.cacheKey = key;
86890- self.cachePaths = [
86891- external_path_default().join(config_CARGO_HOME, "registry"),
86892- external_path_default().join(config_CARGO_HOME, "git"),
86893- ];
86892+ self.cachePaths = [external_path_default().join(config_CARGO_HOME, "registry"), external_path_default().join(config_CARGO_HOME, "git")];
8689486893 if (self.cacheBin) {
86895- self.cachePaths = [external_path_default().join(config_CARGO_HOME, "bin"), ...self.cachePaths];
86894+ self.cachePaths = [
86895+ external_path_default().join(config_CARGO_HOME, "bin"),
86896+ external_path_default().join(config_CARGO_HOME, ".crates.toml"),
86897+ external_path_default().join(config_CARGO_HOME, ".crates2.json"),
86898+ ...self.cachePaths,
86899+ ];
8689686900 }
8689786901 const cacheTargets = lib_core.getInput("cache-targets").toLowerCase() || "true";
8689886902 if (cacheTargets === "true") {
@@ -87338,7 +87342,9 @@ async function run() {
8733887342 // Pass a copy of cachePaths to avoid mutating the original array as reported by:
8733987343 // https://github.com/actions/toolkit/pull/1378
8734087344 // TODO: remove this once the underlying bug is fixed.
87341- const restoreKey = await cacheProvider.cache.restoreCache(config.cachePaths.slice(), key, [config.restoreKey], { lookupOnly });
87345+ const restoreKey = await cacheProvider.cache.restoreCache(config.cachePaths.slice(), key, [config.restoreKey], {
87346+ lookupOnly,
87347+ });
8734287348 if (restoreKey) {
8734387349 const match = restoreKey === key;
8734487350 lib_core.info(`${lookupOnly ? "Found" : "Restored from"} cache key "${restoreKey}" full match: ${match}.`);
0 commit comments