Skip to content

Commit 4b112e5

Browse files
Revert "refactor: remove explicit rust-toolchain install, rely on preinstalled version"
This reverts commit 320df78.
1 parent 1df3fd0 commit 4b112e5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/rust-build.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Build, Test and Publish Rust Package
33
on:
44
workflow_call:
55
inputs:
6+
rust-version:
7+
description: 'Rust version to use'
8+
default: 'stable'
9+
type: string
610
working-directory:
711
description: 'The directory to run jobs from'
812
default: '.'
@@ -30,8 +34,11 @@ jobs:
3034
- name: Checkout repository
3135
uses: actions/checkout@v4
3236

33-
- name: Add clippy and rustfmt
34-
run: rustup component add clippy rustfmt
37+
- name: Install Rust toolchain
38+
uses: dtolnay/rust-toolchain@stable
39+
with:
40+
toolchain: ${{ inputs.rust-version }}
41+
components: clippy, rustfmt, cargo
3542

3643
- name: Cache dependencies
3744
if: ${{ inputs.enable-cache }}

rust-build/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
build-and-test:
2323
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/rust-build.yml@main
2424
with:
25+
rust-version: 'stable'
2526
working-directory: './my-crate'
2627
enable-cache: true
2728
publish-crates-io: false
@@ -33,6 +34,7 @@ jobs:
3334
3435
| Name | Description | Default | Required |
3536
| ------------------- | --------------------------------------------------------- | -------- | -------- |
37+
| `rust-version` | Rust version to use | `stable` | No |
3638
| `working-directory` | The directory to run jobs from | `.` | No |
3739
| `enable-cache` | Enable caching of dependencies | `true` | No |
3840
| `publish-crates-io` | Publish the package to crates.io (only if build succeeds) | `false` | No |

0 commit comments

Comments
 (0)