Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hecrj/setup-rust-action
Set up a specific Rust toolchain in your GitHub workflows
https://github.com/hecrj/setup-rust-action
Last synced: 10 days ago
JSON representation
Set up a specific Rust toolchain in your GitHub workflows
- Host: GitHub
- URL: https://github.com/hecrj/setup-rust-action
- Owner: hecrj
- License: mit
- Created: 2019-08-15T23:28:01.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-12T00:16:16.000Z (8 months ago)
- Last Synced: 2024-10-15T19:31:53.266Z (25 days ago)
- Language: Shell
- Homepage:
- Size: 845 KB
- Stars: 104
- Watchers: 4
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# setup-rust-action
[![Integration status](https://github.com/hecrj/setup-rust-action/workflows/Integration/badge.svg)](https://github.com/hecrj/setup-rust-action/actions)
Sets up a specific Rust toolchain for use in your GitHub Actions workflows.
# Usage
Provide a `rust-version` with the desired toolchain version to install.
You can combine it with `matrix` to test different Rust toolchains in different platforms!
```yml
name: Test Rust project
on: [push]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
rust: [stable, nightly]steps:
- uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
- uses: actions/checkout@master
- name: Run tests
run: cargo test --verbose
```## Inputs
The following inputs can be provided with the `jobs..steps.with` yaml key.
| Name | Optional | Description | Type | Default |
|--------------|:-------------------------:|--------------------------------------------------------|-------------------------|---------|
| rust-version | :heavy_check_mark: | The toolchain name, such as stable, nightly, or 1.8.0 | String | stable |
| components | :heavy_check_mark: | The toolchain components to install | String, comma-separated | |
| targets | :heavy_check_mark: | The toolchain targets to add | String, comma-separated | |For more details, check out [`action.yml`].
[`action.yml`]: https://github.com/hecrj/setup-rust-action/blob/master/action.yml
## Problem Matchers
This action registers the following [problem matchers](https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md) to surface relevant information inline with changeset diffs.
* `cargo-common` matches common cases of errors and warnings
* `cargo-test` matches cargo test errors
* `cargo-fmt` matches rust format errorsTo disable any or all of these you can use the `remove-matcher` directive documented [here](https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers).
# Contributing / Feedback
Contributions and feedback are welcome! Feel free to open any issues or pull requests.