mirror of
https://github.com/Swatinem/rust-cache
synced 2025-06-24 01:03:42 +00:00
Add cache-workspace-crates feature (#246)
This commit is contained in:
parent
901019c0f8
commit
eaa85be6b1
4 changed files with 20 additions and 0 deletions
|
@ -60,6 +60,12 @@ sensible defaults.
|
|||
# default: "false"
|
||||
cache-all-crates: ""
|
||||
|
||||
# Similar to cache-all-crates.
|
||||
# If `true` the workspace crates will be cached.
|
||||
# Useful if the workspace contains libraries that are only updated sporadically.
|
||||
# default: "false"
|
||||
cache-workspace-crates: ""
|
||||
|
||||
# Determines whether the cache should be saved.
|
||||
# If `false`, the cache is only restored.
|
||||
# Useful for jobs where the matrix is additive e.g. additional Cargo features,
|
||||
|
|
|
@ -32,6 +32,10 @@ inputs:
|
|||
description: "Determines which crates are cached. If `true` all crates will be cached, otherwise only dependent crates will be cached."
|
||||
required: false
|
||||
default: "false"
|
||||
cache-workspace-crates:
|
||||
description: "Similar to cache-all-crates. If `true` the workspace crates will be cached."
|
||||
required: false
|
||||
default: "false"
|
||||
save-if:
|
||||
description: "Determiners whether the cache should be saved. If `false`, the cache is only restored."
|
||||
required: false
|
||||
|
|
5
dist/save/index.js
vendored
5
dist/save/index.js
vendored
|
@ -87340,9 +87340,14 @@ async function run() {
|
|||
if (process.env["RUNNER_OS"] == "macOS") {
|
||||
await macOsWorkaround();
|
||||
}
|
||||
const workspaceCrates = core.getInput("cache-workspace-crates").toLowerCase() || "false";
|
||||
const allPackages = [];
|
||||
for (const workspace of config.workspaces) {
|
||||
const packages = await workspace.getPackagesOutsideWorkspaceRoot();
|
||||
if (workspaceCrates === "true") {
|
||||
const wsMembers = await workspace.getWorkspaceMembers();
|
||||
packages.push(...wsMembers);
|
||||
}
|
||||
allPackages.push(...packages);
|
||||
try {
|
||||
core.info(`... Cleaning ${workspace.target} ...`);
|
||||
|
|
|
@ -36,9 +36,14 @@ async function run() {
|
|||
await macOsWorkaround();
|
||||
}
|
||||
|
||||
const workspaceCrates = core.getInput("cache-workspace-crates").toLowerCase() || "false";
|
||||
const allPackages = [];
|
||||
for (const workspace of config.workspaces) {
|
||||
const packages = await workspace.getPackagesOutsideWorkspaceRoot();
|
||||
if (workspaceCrates === "true") {
|
||||
const wsMembers = await workspace.getWorkspaceMembers();
|
||||
packages.push(...wsMembers);
|
||||
}
|
||||
allPackages.push(...packages);
|
||||
try {
|
||||
core.info(`... Cleaning ${workspace.target} ...`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue