Coder Social home page Coder Social 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

Stargazers

zurgl avatar David Selassie avatar Orhun Parmaksız avatar A5 Pickle avatar Kevin Heavey avatar Zicklag avatar [eureka@nixos] avatar Markus Kohlhase avatar Jakub Trąd avatar Patryk Wychowaniec avatar MOZGIII avatar Agost Biro avatar Minoru Mizutani avatar Daniil Polyakov avatar Andrejs Agejevs avatar Rain avatar buffalu avatar Alessio Marchi avatar Kyle Lacy avatar Shun Kakinoki avatar Ray avatar Abhishek Shah avatar tianya avatar Hoang Phan avatar Divy Srivastava avatar Ryota Murakami avatar

Watchers

 avatar Jonas Wanke avatar  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.