Skip to content

Commit

Permalink
Use toolchain action to install Rust (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
idavis authored Jul 2, 2024
1 parent db680a7 commit b58a9ef
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/actions/rust-toolchain/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: rust-toolchain
description: "Install a Rust toolchain."

inputs:
toolchain:
description: "The toolchain name. Usually a version number."
required: false
components:
description: "Additional components to install."
required: false

runs:
using: composite
steps:
- shell: pwsh
run: |
rustup override set ${{ inputs.toolchain || 'stable' }}
${{ inputs.components && format('rustup component add {0}', inputs.components) }}
cargo --version
rustc --version
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ jobs:
with:
version: "14.0"
- name: Setup rust toolchain
run: rustup show

uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.78.0
components: rustfmt clippy
- name: cargo fmt
run: cargo fmt -v --all -- --check

Expand Down Expand Up @@ -86,7 +88,10 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup rust toolchain
run: rustup show
uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.78.0
components: rustfmt clippy
- name: Install LLVM
uses: ./.github/actions/install-llvm
with:
Expand Down

0 comments on commit b58a9ef

Please sign in to comment.