File tree Expand file tree Collapse file tree 4 files changed +20
-0
lines changed
Expand file tree Collapse file tree 4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,12 @@ sensible defaults.
6060 # default: "false"
6161 cache-all-crates : " "
6262
63+ # Similar to cache-all-crates.
64+ # If `true` the workspace crates will be cached.
65+ # Useful if the workspace contains libraries that are only updated sporadically.
66+ # default: "false"
67+ cache-workspace-crates : " "
68+
6369 # Determines whether the cache should be saved.
6470 # If `false`, the cache is only restored.
6571 # Useful for jobs where the matrix is additive e.g. additional Cargo features,
Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ inputs:
3232 description : " Determines which crates are cached. If `true` all crates will be cached, otherwise only dependent crates will be cached."
3333 required : false
3434 default : " false"
35+ cache-workspace-crates :
36+ description : " Similar to cache-all-crates. If `true` the workspace crates will be cached."
37+ required : false
38+ default : " false"
3539 save-if :
3640 description : " Determiners whether the cache should be saved. If `false`, the cache is only restored."
3741 required : false
Original file line number Diff line number Diff line change @@ -87340,9 +87340,14 @@ async function run() {
8734087340 if (process.env["RUNNER_OS"] == "macOS") {
8734187341 await macOsWorkaround();
8734287342 }
87343+ const workspaceCrates = core.getInput("cache-workspace-crates").toLowerCase() || "false";
8734387344 const allPackages = [];
8734487345 for (const workspace of config.workspaces) {
8734587346 const packages = await workspace.getPackagesOutsideWorkspaceRoot();
87347+ if (workspaceCrates === "true") {
87348+ const wsMembers = await workspace.getWorkspaceMembers();
87349+ packages.push(...wsMembers);
87350+ }
8734687351 allPackages.push(...packages);
8734787352 try {
8734887353 core.info(`... Cleaning ${workspace.target} ...`);
Original file line number Diff line number Diff line change @@ -36,9 +36,14 @@ async function run() {
3636 await macOsWorkaround ( ) ;
3737 }
3838
39+ const workspaceCrates = core . getInput ( "cache-workspace-crates" ) . toLowerCase ( ) || "false" ;
3940 const allPackages = [ ] ;
4041 for ( const workspace of config . workspaces ) {
4142 const packages = await workspace . getPackagesOutsideWorkspaceRoot ( ) ;
43+ if ( workspaceCrates === "true" ) {
44+ const wsMembers = await workspace . getWorkspaceMembers ( ) ;
45+ packages . push ( ...wsMembers ) ;
46+ }
4247 allPackages . push ( ...packages ) ;
4348 try {
4449 core . info ( `... Cleaning ${ workspace . target } ...` ) ;
You can’t perform that action at this time.
0 commit comments