Skip to content

Set up a specific Rust toolchain in your GitHub workflows

License

Notifications You must be signed in to change notification settings

hecrj/setup-rust-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Name Optional 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.

About

Set up a specific Rust toolchain in your GitHub workflows

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages