Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Afterward, the `components` and `target` specified via inputs are installed in a
| `toolchain` | Comma-separated list of Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. The last version is the default. | 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` | |
| `cargo-packages` | Comma-separated string of Cargo packages to install e.g. `cargo-edit, cargo-tarpaulin` | |
| `cache` | Automatically configure Rust cache (using [`Swatinem/rust-cache`]) | true |
| `cache-directories` | Propagates the value to [`Swatinem/rust-cache`] | |
| `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | |
Expand Down
12 changes: 11 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ inputs:
components:
description: "Comma-separated list of components to be additionally installed"
required: false
cargo-packages:
description: "Comma-separated list of Cargo packages to be additionally installed"
required: false
cache:
description: "Automatically configure Rust cache"
required: false
Expand Down Expand Up @@ -134,7 +137,7 @@ runs:
run: |
if ! command -v rustup &> /dev/null ; then
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y

# Resolve the correct CARGO_HOME path depending on OS
if [[ "$RUNNER_OS" == "Windows" ]]; then
echo "${CARGO_HOME:-$USERPROFILE/.cargo}/bin" | sed 's|/|\\|g' >> $GITHUB_PATH
Expand Down Expand Up @@ -179,6 +182,13 @@ runs:
fi
fi

- name: Install additional Cargo packages
if: inputs.cargo-packages != ''
env:
packages: ${{inputs.cargo-packages}}
shell: bash
run: cargo install ${packages//,/ }

- id: versions
name: Print installed versions
shell: bash
Expand Down