mirror of
https://github.com/Swatinem/rust-cache.git
synced 2025-07-19 07:11:24 +03:00
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:
6
dist/restore/index.js
vendored
6
dist/restore/index.js
vendored
@ -60234,7 +60234,7 @@ async function cleanBin() {
|
||||
}
|
||||
}
|
||||
}
|
||||
async function cleanRegistry(packages) {
|
||||
async function cleanRegistry(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"));
|
||||
@ -60252,6 +60252,10 @@ async function cleanRegistry(packages) {
|
||||
// TODO: else, clean `.cache` based on the `packages`
|
||||
}
|
||||
}
|
||||
if (!crates) {
|
||||
core.debug(`skipping crate cleanup`);
|
||||
return;
|
||||
}
|
||||
const pkgSet = new Set(packages.map((p) => `${p.name}-${p.version}.crate`));
|
||||
// `.cargo/registry/cache`
|
||||
const cacheDir = await fs.promises.opendir(path.join(CARGO_HOME, "registry", "cache"));
|
||||
|
Reference in New Issue
Block a user