Skip to content

Commit f2e9ed5

Browse files
committed
add workspaces input field to support non-root projects
1 parent d5fcac4 commit f2e9ed5

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ 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` | Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. | 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-
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
58-
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
51+
| Name | Description | Default |
52+
|--------------------|----------------------------------------------------------------------------------------|---------------|
53+
| `toolchain` | Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. | 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-workspaces` | Propagates the value to `Swatinem/rust-cache` | |
58+
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
59+
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
5960

6061
### RUSTFLAGS
6162

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ inputs:
2525
description: "Automatically configure Rust cache"
2626
required: false
2727
default: "true"
28+
cache-workspaces:
29+
description: "Paths to multiple Cargo workspaces and their target directories, separated by newlines."
30+
required: false
2831
matcher:
2932
description: "Enable the Rust problem matcher"
3033
required: false
@@ -171,3 +174,5 @@ runs:
171174
- name: Setup Rust Caching
172175
if: inputs.cache == 'true'
173176
uses: Swatinem/rust-cache@v2
177+
with:
178+
workspaces: ${{inputs.cache-workspaces}}

0 commit comments

Comments
 (0)