Files
Pake/.github/actions/setup-rust.yml
2025-08-29 17:30:37 +08:00

45 lines
1.3 KiB
YAML
Vendored

name: Setup Rust Environment
description: Install and configure Rust toolchain with platform-specific targets
inputs:
platform:
description: Platform to setup Rust for
required: true
components:
description: Additional Rust components to install
required: false
default: ''
runs:
using: composite
steps:
- name: Install Rust for Linux
if: contains(inputs.platform, 'ubuntu')
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
components: ${{ inputs.components }}
- name: Install Rust for Windows
if: contains(inputs.platform, 'windows')
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable-x86_64-msvc
target: x86_64-pc-windows-msvc
components: ${{ inputs.components }}
- name: Install Rust for macOS
if: contains(inputs.platform, 'macos')
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-apple-darwin
components: ${{ inputs.components }}
- name: Add macOS universal targets
if: contains(inputs.platform, 'macos')
shell: bash
run: |
rustup target add aarch64-apple-darwin
rustup target add x86_64-apple-darwin