Skip to content

wackbyte/rust-toolchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install Rust Toolchain

This Action installs a Rust toolchain using rustup. It is designed to be easy to use with good defaults.

Project information

This project is a fork of dtolnay/rust-toolchain with a greater focus on stability and ease of use at the cost of one-line usage. It intends to expressly support all of GitHub, Gitea, and Forgejo Actions.

Available mirrors

This repository is mirrored on a few different remotes:

Please only submit issues and pull requests on Codeberg.

Example workflow

name: CI
on:
  push:
  pull_request:

jobs:
  test:
    name: cargo test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - uses: wackbyte/rust-toolchain@trunk
        with:
          toolchain: stable

      - run: cargo test --all-features

Inputs

Name Description Default value
toolchain

rustup toolchain name. It is recommended to use quotes in order to avoid versions being parsed as floating-point numbers.

Example values:

  • stable
  • nightly
  • 1.42.0
  • nightly-2022-01-01

(documentation)

(required)
targets

Comma-separated list of target triples to be additionally installed for this toolchain.

Example value: wasm32-unknown-unknown

(documentation)

(empty)
components

Comma-separated list of components to be additionally installed for this toolchain.

Example value: clippy, rustfmt

(documentation)

(empty)
profile

Group of components to install for this toolchain. It is recommended to use minimal in CI so that the minimum number of components is installed.

Available values:

  • minimal
  • default
  • complete

(documentation)

minimal
default

Set this toolchain as default. Equivalent to running rustup default with this toolchain.

(documentation)

false
override

Set this toolchain as an override for this directory. Equivalent to running rustup override set with this toolchain. This is helpful if a rustup-toolchain.toml or rustup-toolchain file is present in the directory and you would like to use this toolchain instead.

(documentation)

false

Outputs

Name Description
cachekey

A short hash of the installed rustc version. Appropriate for use as a cache key.

Example value: 20220627a831

name

rustup's name for the selected version of the toolchain. Suitable for use with the cargo +toolchain shorthand.

Example value: 1.62.0

Toolchain expressions

The following forms are available for projects that use a sliding window of compiler support.

# Installs the most recent stable toolchain as of the specified time offset,
# which may be written in years, months, weeks, or days.
- uses: wackbyte/rust-toolchain@trunk
  with:
    toolchain: stable 18 months ago
# Installs the stable toolchain which preceded the most recent one by the
# specified number of minor versions.
- uses: wackbyte/rust-toolchain@trunk
  with:
    toolchain: stable minus 8 releases

License

The scripts and documentation in this project are released under the MIT License.