Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Set up a specific Rust toolchain in your GitHub workflows
TypeScript JavaScript
Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
Branch: master
Clone or download
hecrj Merge pull request #16 from CryZe/patch-1
Fix cargo-fmt problem matcher
Latest commit e0938ba Jan 21, 2020
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
dist Merge branch 'master' into problem-matchers Jan 6, 2020
src
.gitignore Initial commit Aug 15, 2019
LICENSE Update `README` and perform some cleanup Aug 15, 2019
README.md Fix `README` Jan 6, 2020
action.yml prefer ncc for packaging Jan 6, 2020
jest.config.js
package-lock.json Update `package-lock.json` Jan 6, 2020
package.json prefer ncc for packaging Jan 6, 2020
tsconfig.json Initial commit Aug 15, 2019

README.md

setup-rust-action

Integration status

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!

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@v1
      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.<job_id>.steps.with yaml key.

Name Required Description Type Default
rust-version The toolchain name, such as stable, nightly, or 1.8.0 String stable
components The toolchain components to install String, comma-separated
targets The toolchain targets to add String, comma-separated

For more details, check out action.yml.

Problem Matchers

This action registers the following problem matchers 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 errors

To disable any or all of these you can use the remove-matcher directive documented here.

Contributing / Feedback

Contributions and feedback are welcome! Feel free to open any issues or pull requests.

You can’t perform that action at this time.