Setup a specific Rust toolchain with extra features like problem matchers
Go to file
Jonas Bushart 29a2385140 Better and more verbose version printing and cachekey version. 2022-07-19 19:00:36 +00:00
.github Create dependabot configuration for GitHub Actions 2022-07-19 20:16:04 +02:00
CHANGELOG.md Better and more verbose version printing and cachekey version. 2022-07-19 19:00:36 +00:00
LICENSE Initial commit 2022-04-17 21:06:51 +02:00
README.md Add README 2022-04-20 19:33:41 +00:00
action.yml Better and more verbose version printing and cachekey version. 2022-07-19 19:00:36 +00:00
rust.json Create rust.json 2022-04-17 21:11:26 +02:00

README.md

Install Rust Toolchain

This GitHub Action installs a Rust toolchain using rustup. It further integrates into the ecosystem. Caching for Rust tools and build artifacts is enabled. Environment variables are set to optimize the cache hits. Problem Matchers are provided for build messages (cargo, clippy) and formatting (rustfmt).

The action is heavily inspired by dtolnay's https://github.com/dtolnay/rust-toolchain and extends it with further features.

Example workflow

name: "Test Suite"
on:
  push:
  pull_request:

jobs:
  test:
    name: cargo test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions-rust-lang/setup-rust-toolchain@v1
      - run: cargo test --all-features

Inputs

All inputs are optional.

Name Description Default
toolchain Rustup toolchain specifier e.g. stable, nightly, 1.42.0. 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

Outputs

Name Description
rustc-version Version as reported by rustc --version
cargo-version Version as reported by cargo --version
rustup-version Version as reported by rustup --version

License

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