feat: install cargo packages

This commit is contained in:
ReenigneArcher 2025-06-14 10:44:37 -04:00
parent 9d7e65c320
commit 512e2f755a
No known key found for this signature in database
GPG key ID: 362B4EC0ADC98755
2 changed files with 12 additions and 1 deletions

View file

@ -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
@ -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
@ -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