File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ First, all items specified in the toolchain file are installed.
49
49
Afterward, the `components` and `target` specified via inputs are installed in addition to the items from the toolchain file.
50
50
51
51
| Name | Description | Default |
52
- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------- | ------------- |
52
+ |--------------------------| ------------------------------------------------------------------------------------------------------------------------- | ------------- |
53
53
| `toolchain` | Comma-separated list of Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. The last version is the default. | stable |
54
54
| `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | |
55
55
| `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | |
@@ -66,6 +66,7 @@ Afterward, the `components` and `target` specified via inputs are installed in a
66
66
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
67
67
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
68
68
| `override` | Setup the last installed toolchain as the default via `rustup override` | true |
69
+ | `rust-toolchain-dir` | Path from root directory to directory with the rust toolchain file (if its not in the root of the repository) | |
69
70
70
71
[`Swatinem/rust-cache`] : https://github.com/Swatinem/rust-cache
71
72
Original file line number Diff line number Diff line change @@ -69,6 +69,9 @@ inputs:
69
69
description : " Setup the last installed toolchain as the default via `rustup override`"
70
70
required : false
71
71
default : " true"
72
+ rust-toolchain-dir :
73
+ description : " Specify path from root directory to the directory to search for rust-toolchain.toml file. By default root directory will be used."
74
+ required : false
72
75
73
76
outputs :
74
77
rustc-version :
@@ -163,14 +166,18 @@ runs:
163
166
targets : ${{inputs.target}}
164
167
components : ${{inputs.components}}
165
168
override : ${{inputs.override}}
169
+ rust_toolchain_dir : ${{inputs.rust-toolchain-dir}}
166
170
shell : bash
167
171
run : |
168
- if [[ -z "$toolchain" && ( -f "rust-toolchain" || -f "rust-toolchain.toml" ) ]]
172
+ if [[ -z "$toolchain" && ( -f "rust-toolchain" || -f "rust-toolchain.toml" || -f "$rust_toolchain_dir/rust-toolchain.toml" ) ]]
169
173
then
170
174
# Install the toolchain as specified in the file
171
175
# rustup show is the old way that implicitly installed a toolchain
172
176
# rustup toolchain install is the new explicit way
173
177
# https://github.com/rust-lang/rustup/issues/3635#issuecomment-2343511297
178
+ if [[ -n "$rust_toolchain_dir" ]]; then
179
+ cd "$rust_toolchain_dir"
180
+ fi
174
181
rustup show active-toolchain || rustup toolchain install
175
182
if [[ -n $components ]]; then
176
183
rustup component add ${components//,/ }
You can’t perform that action at this time.
0 commit comments