mirror of
https://github.com/Swatinem/rust-cache
synced 2025-06-08 17:43:25 +00:00
When cache-all-crates == true, don't remove workspace members target
This commit is contained in:
parent
27b8ea9368
commit
2c11e3358f
1 changed files with 5 additions and 1 deletions
|
@ -36,9 +36,14 @@ async function run() {
|
||||||
await macOsWorkaround();
|
await macOsWorkaround();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const crates = core.getInput("cache-all-crates").toLowerCase() || "false";
|
||||||
const allPackages = [];
|
const allPackages = [];
|
||||||
for (const workspace of config.workspaces) {
|
for (const workspace of config.workspaces) {
|
||||||
const packages = await workspace.getPackagesOutsideWorkspaceRoot();
|
const packages = await workspace.getPackagesOutsideWorkspaceRoot();
|
||||||
|
if (crates === "true") {
|
||||||
|
const wsMembers = await workspace.getWorkspaceMembers();
|
||||||
|
packages.push(...wsMembers);
|
||||||
|
}
|
||||||
allPackages.push(...packages);
|
allPackages.push(...packages);
|
||||||
try {
|
try {
|
||||||
core.info(`... Cleaning ${workspace.target} ...`);
|
core.info(`... Cleaning ${workspace.target} ...`);
|
||||||
|
@ -49,7 +54,6 @@ async function run() {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const crates = core.getInput("cache-all-crates").toLowerCase() || "false";
|
|
||||||
core.info(`... Cleaning cargo registry (cache-all-crates: ${crates}) ...`);
|
core.info(`... Cleaning cargo registry (cache-all-crates: ${crates}) ...`);
|
||||||
await cleanRegistry(allPackages, crates !== "true");
|
await cleanRegistry(allPackages, crates !== "true");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue