百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

setup-rust-toolchain

> DevOps
开源

设置具有额外功能(如问题匹配器)的特定 Rust 工具链

397 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

设置具有额外功能(如问题匹配器)的特定 Rust 工具链

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 and extends it with further features.

Example workflow

…

Inputs

All inputs are optional. If a toolchain file (i.e., rust-toolchain or rust-toolchain.toml) is found in the root of the repository and no toolchain value is provided, all items specified in the toolchain file will be installed. If a toolchain value is provided, the toolchain file will be ignored. If no toolchain value or toolchain file is present, it will default to stable. First, all items specified in the toolchain file are installed. Afterward, the components and target specified via inputs are installed in addition to the items from the toolchain file.

Name Description Default
toolchain Comma-separated list of Rustup toolchain specifier e.g. stable, nightly, 1.42.0. The last version is the default. stable
target Additional target support to install e.g. wasm32-unknown-unknown
build-warnings Sets the build.warnings config via the CARGO_BUILD_WARNINGS variable. (set to empty string to avoid overwriting existing flags) deny
components Comma-separated string of additional components to install e.g. clippy, rustfmt
cache Automatically configure Rust cache (using Swatinem/rust-cache) true
cache-directories Propagates the value to Swatinem/rust-cache
cache-workspaces Propagates the value to Swatinem/rust-cache. Influenced by the value of rust-src-dir.
cache-on-failure Propagates the value to Swatinem/rust-cache true
cache-key Propagates the value to Swatinem/rust-cache as key
cache-shared-key Propagates the value to Swatinem/rust-cache as shared-key
cache-bin Propagates the value to Swatinem/rust-cache as cache-bin true
cache-provider Propagates the value to Swatinem/rust-cache as cache-provider 'github'
cache-all-crates Propagates the value to Swatinem/rust-cache as cache-all-crates false
cache-workspace-crates Propagates the value to Swatinem/rust-cache as cache-workspace-crates false
cache-save-if Propagates the value to Swatinem/rust-cache as save-if true
cache-targets Propagates the value to Swatinem/rust-cache as cache-targets true
matcher Enable problem matcher to surface build messages and formatting issues true
rustflags Set the value of RUSTFLAGS (set to empty string to avoid overwriting existing flags) ""
override Setup the last installed toolchain as the default via rustup override true
rust-src-dir Path from root directory to directory with the Rust source directory (if its not in the root of the repository). Sets a default value for cache-workspaces that enables caching.

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
cachekey A short hash of the installed rustc version

Dependencies

The action works best on the GitHub-hosted runners, but can work on self-hosted ones too, provided the necessary dependencies are available. PRs to add support for more environments are welcome.

  • bash 5
  • brew (macOS only)
  • rustup or curl
  • using other node actions

License

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

Issues· 3 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustcigithub-actionshacktoberfestproblem-matcher

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类DevOps
定价开源

> 相关工具

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理