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 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 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 | | ------------ | --------------------------------------------------------------------------------- | ------- | 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