feat: add option to cache all crates (#137)
Add cache-all-crates option which allows all crates to be cached instead of just the dependency crates. This is useful when additional crates are required for CI tooling.
This commit is contained in:
@@ -85,7 +85,7 @@ export async function cleanBin() {
|
||||
}
|
||||
}
|
||||
|
||||
export async function cleanRegistry(packages: Packages) {
|
||||
export async function cleanRegistry(packages: Packages, crates = true) {
|
||||
// `.cargo/registry/src`
|
||||
// we can remove this completely, as cargo will recreate this from `cache`
|
||||
await rmRF(path.join(CARGO_HOME, "registry", "src"));
|
||||
@@ -106,6 +106,11 @@ export async function cleanRegistry(packages: Packages) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!crates) {
|
||||
core.debug(`skipping crate cleanup`);
|
||||
return;
|
||||
}
|
||||
|
||||
const pkgSet = new Set(packages.map((p) => `${p.name}-${p.version}.crate`));
|
||||
|
||||
// `.cargo/registry/cache`
|
||||
|
||||
Reference in New Issue
Block a user