From 7229efd154dfa392431d906979df76b5551efd17 Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Mon, 8 May 2023 10:21:58 -0700 Subject: [PATCH] docs: Add inputs to readme. --- README.md | 30 +++++++++++++++++++++++++++--- action.yml | 8 ++++---- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5f27074..316e475 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,21 @@ jobs: - run: cargo test ``` +## Inputs + +The following inputs are available for the action, and can be passed via `with`. All inputs are +optional. + +- `bins` - Comma-separated list of global binaries to install into Cargo. +- `cache` - Toggle caching of directories. Defaults to `true`. +- `cache-target` - Name of the target profile to cache. Defaults to `debug`. +- `channel` - Toolchain specification/channel to explicitly install. +- `components` - Comma-separated list of additional components to install. +- `inherit-toolchain` - Inherit all toolchain settings from the `rust-toolchain.toml` file. Defaults + to `false`. +- `targets` - Comma-separated list of additional targets to install. +- `profile` - Profile to install. Defaults to `minimal`. + ## Configuring the Rust toolchain This action will automatically install the appropriate toolchain with `rustup` by inspecting the @@ -41,10 +56,11 @@ highest precedence. channel: '1.65.0' ``` -### Profile and components +### Profile, components, and targets -Furthermore, this action supports rustup profiles and components, which can be configured with the -`profile` and `components` inputs respectively. When not defined, profile defaults to `minimal`. +Furthermore, this action supports rustup profiles, components, and targets, which can be configured +with the `profile`, `components`, and `targets` inputs respectively. When not defined, profile +defaults to `minimal`. ```yaml - uses: moonrepo/setup-rust@v0 @@ -61,6 +77,14 @@ When using components, the input requires a comma separated list of component na - run: cargo clippy --workspace ``` +When using targets, the input requires a comma separated list of target triples. + +```yaml +- uses: moonrepo/setup-rust@v0 + with: + targets: 'x86_64-pc-windows-msvc,x86_64-pc-windows-gnu' +``` + ## Installing Cargo binaries If you require `cargo-make`, `cargo-nextest`, or other global binaries, this action supports diff --git a/action.yml b/action.yml index 7f9d2ee..3fa930a 100644 --- a/action.yml +++ b/action.yml @@ -13,16 +13,16 @@ inputs: description: 'Name of the target profile to cache.' default: 'debug' channel: - description: 'Toolchain specification/channel to install.' + description: 'Toolchain specification/channel to explicitly install.' components: description: 'Comma-separated list of additional components to install.' + inherit-toolchain: + description: 'Inherit all toolchain settings from the rust-toolchain.toml file.' + default: false targets: description: 'Comma-separated list of additional targets to install.' profile: description: 'Profile to install. Defaults to "minimal".' - inherit-toolchain: - description: 'Inherit all toolchain settings from the rust-toolchain.toml file.' - default: false outputs: cache-key: description: 'The generated cache key used.'