Code Monkey home page Code Monkey logo

rust-toolchain-file's Introduction

Install Rust Toolchain via rust-toolchain.toml

GitHub Action to install Rust's toolchain via the rust-toolchain.toml file in your repository.

Fork of https://github.com/dtolnay/rust-toolchain that supports and makes it mandatory to use a rust-toolchain.toml file. Unfortunately rust-toolchain did not want to support installing from a rust-toolchain.toml file, so this project exists. If you do not want to use a rust-toolchain.toml file, then please use that project as this action does not support other inputs.

Note: GitHub actions now automatically sets up the Rust version based on the rust-toolchain.toml, but it won't setup the other defaults from dtolnay/rust-toolchain for you like enabling colours on the CI as this action will.

Example workflow

  1. Create a rust-toolchain.toml file in the root directory of your repository:

    [toolchain]
    channel = "1.68"
    components = [ "rustfmt", "clippy" ]
  2. Add an entry to this action in your GitHub Actions workflow file (ensure the repo is checked out first):

    name: test suite
    on: [push, pull_request]
    
    jobs:
      test:
        name: cargo test
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v3
          - uses: dsherret/rust-toolchain-file@v1
          - run: cargo test --all-features

The selection of Rust toolchain on the CI will then be made based on the rust-toolchain.toml file enabling you to easily keep it in sync with your local development versions and have a single source of truth for what version to use.

Inputs

You must define everything in the rust-toolchain.toml file.

Outputs

Name Description
cachekey A short hash of the installed rustc version, appropriate for use as a cache key. "20220627a831"
name Rustup's name for the selected version of the toolchain, like "1.62.0". Suitable for use with cargo +${{steps.toolchain.outputs.name}}.

License

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

rust-toolchain-file's People

Contributors

dtolnay avatar dsherret avatar thomcc avatar alex avatar 9999years avatar stackoverflowexcept1on avatar silwol avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.