From 03aaf6be762c8d3210b63c7af545f6974206c1e4 Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Sat, 20 May 2023 16:29:33 +0200 Subject: [PATCH 1/4] Check that listed components are installed even with a rust-toolchain file --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f84d14e..ee6fda8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,7 @@ jobs: id: toolchain with: toolchain: ${{matrix.rust}} + components: clippy - name: Check ${{'${{steps.toolchain.outputs.rustc-version}}'}} run: echo '${{steps.toolchain.outputs.rustc-version}}' - name: Check ${{'${{steps.toolchain.outputs.cargo-version}}'}} @@ -62,4 +63,4 @@ jobs: # Add tiny empty crate. # This checks that registry access works. - run: cargo add serde_as - - run: cargo check + - run: cargo clippy From b065e5ab9fefe5f13e4dfafaf0219438660fbf7b Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Sat, 20 May 2023 16:38:07 +0200 Subject: [PATCH 2/4] Install components and targets after installing everything from the rust-toolchain file --- action.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/action.yml b/action.yml index c101878..d91e807 100644 --- a/action.yml +++ b/action.yml @@ -108,10 +108,19 @@ runs: # Install the toolchain as specified in the file # Might break at some point: https://github.com/rust-lang/rustup/issues/1397 rustup show + if [[ -n $components ]]; then + rustup component add ${components//,/ } + fi + if [[ -n $targets ]]; then + rustup target add ${targets//,/ } + fi else rustup toolchain install ${{inputs.toolchain}}${{steps.flags.outputs.targets}}${{steps.flags.outputs.components}} --profile minimal${{steps.flags.outputs.downgrade}} --no-self-update rustup default ${{inputs.toolchain}} fi + env: + targets: ${{inputs.target}} + components: ${{inputs.components}} shell: bash - name: Print installed versions From 661e2d23ddc2fd440e330724c30adbb12a1571de Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Sat, 20 May 2023 18:03:52 +0200 Subject: [PATCH 3/4] Explain the new behavior in the README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 542a423..4515c04 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,9 @@ jobs: ## Inputs All inputs are optional. -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. -All input values are ignored if a toolchain file exists. +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. +First, all items specified in the toolchain file are installed. +Afterward, the `components` and `target` specified via inputs are installed in addition to the items from the toolchain file. | Name | Description | Default | | ------------ | --------------------------------------------------------------------------------- | ------- | From 289d5e6164cb915bfdbe6d5f0d5e0fafaed2d4b0 Mon Sep 17 00:00:00 2001 From: Jonas Bushart Date: Mon, 29 May 2023 20:31:27 +0200 Subject: [PATCH 4/4] Add changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ada14c5..5a140dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.5.0] - 2023-05-29 + +### Added + +* Support installing additional components and targets that are not listed in `rust-toolchain` (#14) + Before only the items listed in `rust-toolchain` were installed. + Now all the items from the toolchain file are installed and then all the `target`s and `components` that are provided as action inputs. + This allows installing extra tools only for CI or simplify testing special targets in CI. + ## [1.4.4] - 2023-03-18 ### Fixed