Skip to content

Commit ab68452

Browse files
committed
Add new parameters cache-all-crates and cache-workspace-crates
Add new parameters `cache-all-crates` and `cache-workspace-crates` that are propagated to `Swatinem/rust-cache` as `cache-all-crates` and `cache-workspace-crates` Closes #67
1 parent fb51252 commit ab68452

File tree

3 files changed

+35
-19
lines changed

3 files changed

+35
-19
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.14.0] - 2025-08-23
11+
12+
* Add new parameters `cache-all-crates` and `cache-workspace-crates` that are propagated to `Swatinem/rust-cache` as `cache-all-crates` and `cache-workspace-crates`
13+
1014
## [1.13.0] - 2025-06-16
1115

1216
* Add new parameter `cache-provider` that is propagated to `Swatinem/rust-cache` as `cache-provider` (#65 by @mindrunner)

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,24 @@ If no `toolchain` value or toolchain file is present, it will default to `stable
4848
First, all items specified in the toolchain file are installed.
4949
Afterward, the `components` and `target` specified via inputs are installed in addition to the items from the toolchain file.
5050

51-
| Name | Description | Default |
52-
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------- |
53-
| `toolchain` | Comma-separated list of Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. The last version is the default. | stable |
54-
| `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | |
55-
| `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | |
56-
| `cache` | Automatically configure Rust cache (using [`Swatinem/rust-cache`]) | true |
57-
| `cache-directories` | Propagates the value to [`Swatinem/rust-cache`] | |
58-
| `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | |
59-
| `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true |
60-
| `cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `key` | |
61-
| `cache-shared-key` | Propagates the value to [`Swatinem/rust-cache`] as `shared-key` | |
62-
| `cache-bin` | Propagates the value to [`Swatinem/rust-cache`] as `cache-bin` | true |
63-
| `cache-provider` | Propagates the value to [`Swatinem/rust-cache`] as `cache-provider` | 'github' |
64-
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
65-
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
66-
| `override` | Setup the last installed toolchain as the default via `rustup override` | true |
51+
| Name | Description | Default |
52+
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------- |
53+
| `toolchain` | Comma-separated list of Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. The last version is the default. | stable |
54+
| `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | |
55+
| `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | |
56+
| `cache` | Automatically configure Rust cache (using [`Swatinem/rust-cache`]) | true |
57+
| `cache-directories` | Propagates the value to [`Swatinem/rust-cache`] | |
58+
| `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | |
59+
| `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true |
60+
| `cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `key` | |
61+
| `cache-shared-key` | Propagates the value to [`Swatinem/rust-cache`] as `shared-key` | |
62+
| `cache-bin` | Propagates the value to [`Swatinem/rust-cache`] as `cache-bin` | true |
63+
| `cache-provider` | Propagates the value to [`Swatinem/rust-cache`] as `cache-provider` | 'github' |
64+
| `cache-all-crates` | Propagates the value to [`Swatinem/rust-cache`] as `cache-all-crates` | false |
65+
| `cache-workspace-crates` | Propagates the value to [`Swatinem/rust-cache`] as `cache-workspace-crates` | false |
66+
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
67+
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
68+
| `override` | Setup the last installed toolchain as the default via `rustup override` | true |
6769

6870
[`Swatinem/rust-cache`]: https://github.com/Swatinem/rust-cache
6971

action.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ inputs:
3232
description: "Additional non workspace directories to be cached, separated by newlines."
3333
required: false
3434
cache-on-failure:
35-
description: "Also cache on workflow failures"
35+
description: "Cache even if the build fails."
3636
default: "true"
3737
required: false
3838
cache-key:
@@ -46,9 +46,17 @@ inputs:
4646
required: false
4747
default: "true"
4848
cache-provider:
49-
description: "Determines which provider to use for caching. Options are github or buildjet, defaults to github."
49+
description: "Determines which provider to use for caching. Options are github, buildjet, or warpbuild. Defaults to github."
5050
required: false
5151
default: "github"
52+
cache-all-crates:
53+
description: "Determines which crates are cached. If `true` all crates will be cached, otherwise only dependent crates will be cached."
54+
required: false
55+
default: "false"
56+
cache-workspace-crates:
57+
description: "Determines which crates are cached. If `true` all crates will be cached, otherwise only dependent crates will be cached."
58+
required: false
59+
default: "false"
5260
matcher:
5361
description: "Enable the Rust problem matcher"
5462
required: false
@@ -138,7 +146,7 @@ runs:
138146
run: |
139147
if ! command -v rustup &> /dev/null ; then
140148
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
141-
149+
142150
# Resolve the correct CARGO_HOME path depending on OS
143151
if [[ "$RUNNER_OS" == "Windows" ]]; then
144152
echo "${CARGO_HOME:-$USERPROFILE/.cargo}/bin" | sed 's|/|\\|g' >> $GITHUB_PATH
@@ -219,5 +227,7 @@ runs:
219227
cache-on-failure: ${{inputs.cache-on-failure}}
220228
cache-bin: ${{inputs.cache-bin}}
221229
cache-provider: ${{inputs.cache-provider}}
230+
cache-all-crates: ${{inputs.cache-all-crates}}
231+
cache-workspace-crates: ${{inputs.cache-workspace-crates}}
222232
key: ${{inputs.cache-key}}
223233
shared-key: ${{inputs.cache-shared-key}}

0 commit comments

Comments
 (0)