Install a Rust toolchain specification and optional rustup components and targets in a GitHub Actions workflow.
GitHub-hosted Linux, Windows, and macOS runners include Bash and rustup. Self-hosted runners must provide both.
| Input | Required | Default | Description |
|---|---|---|---|
toolchain |
Yes | — | Rustup toolchain specification. |
components |
No | "" |
Space-separated rustup component names. |
targets |
No | "" |
Space-separated rustup target names. |
toolchain accepts a standard
rustup toolchain specification,
including explicit releases such as 1.97.1, the stable, beta, and
nightly channels, and dated nightlies such as nightly-2025-06-26.
Reproducible CI should generally prefer an explicit release or dated nightly
because the channel names move as new toolchains are published.
Use an explicit Rust release:
steps:
- uses: seapagan/setup-rust@v1
with:
toolchain: "1.97.1"Channel names and other rustup toolchain specifications work through the same input. For example, use the current stable channel:
steps:
- uses: seapagan/setup-rust@v1
with:
toolchain: stableInstall optional components for the selected toolchain:
steps:
- uses: seapagan/setup-rust@v1
with:
toolchain: "1.97.1"
components: rustfmt clippyInstall optional Rust target support, including more than one target when needed:
steps:
- uses: seapagan/setup-rust@v1
with:
toolchain: nightly-2025-06-26
targets: wasm32-unknown-unknown thumbv7em-none-eabihf@v1 is the convenient stable major-version reference and may intentionally
move to compatible future v1.x.x releases. Use @v1.0.0 to select this exact
immutable release. Consumers requiring the strongest reproducibility and
supply-chain protection should pin the action to a full commit SHA and retain a
human-readable version comment where practical:
- uses: seapagan/setup-rust@<full-sha> # v1.0.0The action runs rustup toolchain install with --profile minimal, selects that
toolchain for subsequent steps in the job through RUSTUP_TOOLCHAIN, and installs
requested components and targets explicitly for that toolchain. It does not
change rustup's persistent default toolchain.
Installing a target adds Rust's standard library for that target. Cross-compiling may also require a suitable linker, platform SDK, or other external tools; this action does not install them.
Development requires Task, Bash, ShellCheck, shfmt, actionlint, zizmor, and Git. Follow each project's authoritative installation guidance for your platform.
Run the complete mandatory local validation suite from the repository root:
task validateMaintainers can generate or update CHANGELOG.md with:
task changelogThis uses github-changelog-md which must be
installed and available on your PATH. To pass any other CLI options to the task,
place them after --:
task changelog -- -n v1.1.0Run task --list to discover the individual checks. Local validation covers
static checks only. The hosted
Integration workflow remains authoritative
for the action's behavior across GitHub-hosted Linux, Windows, and macOS runners.