From f2e9ed58bdbfcd620ddbb1bdb2af5e676e9a17fd Mon Sep 17 00:00:00 2001 From: gruebel Date: Fri, 12 Jan 2024 18:41:01 +0100 Subject: [PATCH] add workspaces input field to support non-root projects --- README.md | 17 +++++++++-------- action.yml | 5 +++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 03677a4..c87afef 100644 --- a/README.md +++ b/README.md @@ -48,14 +48,15 @@ If no `toolchain` value or toolchain file is present, it will default to `stable First, all items specified in the toolchain file are installed. Afterward, the `components` and `target` specified via inputs are installed in addition to the items from the toolchain file. -| Name | Description | Default | -| ------------ | -------------------------------------------------------------------------------------- | ------------- | -| `toolchain` | Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. | stable | -| `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | | -| `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | | -| `cache` | Automatically configure Rust cache (using `Swatinem/rust-cache`) | true | -| `matcher` | Enable problem matcher to surface build messages and formatting issues | true | -| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" | +| Name | Description | Default | +|--------------------|----------------------------------------------------------------------------------------|---------------| +| `toolchain` | Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. | stable | +| `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | | +| `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | | +| `cache` | Automatically configure Rust cache (using `Swatinem/rust-cache`) | true | +| `cache-workspaces` | Propagates the value to `Swatinem/rust-cache` | | +| `matcher` | Enable problem matcher to surface build messages and formatting issues | true | +| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" | ### RUSTFLAGS diff --git a/action.yml b/action.yml index 45eda54..c5b5e5c 100644 --- a/action.yml +++ b/action.yml @@ -25,6 +25,9 @@ inputs: description: "Automatically configure Rust cache" required: false default: "true" + cache-workspaces: + description: "Paths to multiple Cargo workspaces and their target directories, separated by newlines." + required: false matcher: description: "Enable the Rust problem matcher" required: false @@ -171,3 +174,5 @@ runs: - name: Setup Rust Caching if: inputs.cache == 'true' uses: Swatinem/rust-cache@v2 + with: + workspaces: ${{inputs.cache-workspaces}}