Skip to content

Commit cf60eaf

Browse files
authored
Merge pull request #19 from actions-rust-lang/better-toolchain-support
2 parents ac6bb38 + 289d5e6 commit cf60eaf

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ jobs:
4848
id: toolchain
4949
with:
5050
toolchain: ${{matrix.rust}}
51+
components: clippy
5152
- name: Check ${{'${{steps.toolchain.outputs.rustc-version}}'}}
5253
run: echo '${{steps.toolchain.outputs.rustc-version}}'
5354
- name: Check ${{'${{steps.toolchain.outputs.cargo-version}}'}}
@@ -62,4 +63,4 @@ jobs:
6263
# Add tiny empty crate.
6364
# This checks that registry access works.
6465
- run: cargo add serde_as
65-
- run: cargo check
66+
- run: cargo clippy

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [1.5.0] - 2023-05-29
11+
12+
### Added
13+
14+
* Support installing additional components and targets that are not listed in `rust-toolchain` (#14)
15+
Before only the items listed in `rust-toolchain` were installed.
16+
Now all the items from the toolchain file are installed and then all the `target`s and `components` that are provided as action inputs.
17+
This allows installing extra tools only for CI or simplify testing special targets in CI.
18+
1019
## [1.4.4] - 2023-03-18
1120

1221
### Fixed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ jobs:
4242
## Inputs
4343
4444
All inputs are optional.
45-
If a [toolchain file](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) (i.e., `rust-toolchain` or `rust-toolchain.toml`) is found in the root of the repository, it takes precedence.
46-
All input values are ignored if a toolchain file exists.
45+
If a [toolchain file](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) (i.e., `rust-toolchain` or `rust-toolchain.toml`) is found in the root of the repository, its `toolchain` value takes precedence.
46+
First, all items specified in the toolchain file are installed.
47+
Afterward, the `components` and `target` specified via inputs are installed in addition to the items from the toolchain file.
4748

4849
| Name | Description | Default |
4950
| ------------ | --------------------------------------------------------------------------------- | ------- |

action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,19 @@ runs:
108108
# Install the toolchain as specified in the file
109109
# Might break at some point: https://github.com/rust-lang/rustup/issues/1397
110110
rustup show
111+
if [[ -n $components ]]; then
112+
rustup component add ${components//,/ }
113+
fi
114+
if [[ -n $targets ]]; then
115+
rustup target add ${targets//,/ }
116+
fi
111117
else
112118
rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update
113119
rustup default ${{inputs.toolchain}}
114120
fi
121+
env:
122+
targets: ${{inputs.target}}
123+
components: ${{inputs.components}}
115124
shell: bash
116125

117126
- name: Print installed versions

0 commit comments

Comments
 (0)