mirror of
https://github.com/actions-rust-lang/setup-rust-toolchain.git
synced 2025-12-27 01:54:20 -05:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d7e65c320 | ||
|
|
9988a3d74b | ||
|
|
0ddce9f632 | ||
|
|
d9c91b20fd | ||
|
|
9399c7bb15 | ||
|
|
3c7cfa82dc | ||
|
|
b38f618be2 | ||
|
|
6cbea1a794 | ||
|
|
6f9a9da9f9 | ||
|
|
2ad14f9ee2 | ||
|
|
30081c4da5 | ||
|
|
f8efd60d2d | ||
|
|
97db979bf8 | ||
|
|
11df97af8e |
18
CHANGELOG.md
18
CHANGELOG.md
@@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.12.0] - 2025-04-23
|
||||
|
||||
* Add support for installing rustup on Windows (#58 by @maennchen)
|
||||
This adds support for using Rust on the GitHub provided Windows ARM runners.
|
||||
|
||||
## [1.11.0] - 2025-02-24
|
||||
|
||||
* Add new parameter `cache-bin` that is propagated to `Swatinem/rust-cache` as `cache-bin` (#51 by @enkhjile)
|
||||
* Add new parameter `cache-shared-key` that is propagated to `Swatinem/rust-cache` as `shared-key` (#52 by @skanehira)
|
||||
|
||||
## [1.10.1] - 2024-10-01
|
||||
|
||||
* Fix problem matcher for rustfmt output.
|
||||
The format has changed since https://github.com/rust-lang/rustfmt/pull/5971 and now follows the form "filename:line".
|
||||
Thanks to @0xcypher02 for pointing out the problem.
|
||||
|
||||
## [1.10.0] - 2024-09-23
|
||||
|
||||
* Add new parameter `cache-directories` that is propagated to `Swatinem/rust-cache` (#44 by @pranc1ngpegasus)
|
||||
* Add new parameter `cache-key` that is propagated to `Swatinem/rust-cache` as `key` (#41 by @iainlane)
|
||||
* Make rustup toolchain installation more robust in light of planned changes https://github.com/rust-lang/rustup/issues/3635 and https://github.com/rust-lang/rustup/pull/3985
|
||||
|
||||
12
README.md
12
README.md
@@ -58,6 +58,8 @@ Afterward, the `components` and `target` specified via inputs are installed in a
|
||||
| `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | |
|
||||
| `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true |
|
||||
| `cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `key` | |
|
||||
| `cache-shared-key` | Propagates the value to [`Swatinem/rust-cache`] as `shared-key` | |
|
||||
| `cache-bin` | Propagates the value to [`Swatinem/rust-cache`] as `cache-bin` | true |
|
||||
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
|
||||
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
|
||||
| `override` | Setup the last installed toolchain as the default via `rustup override` | true |
|
||||
@@ -88,6 +90,16 @@ You can read more rustflags, and their load order, in the [Cargo reference].
|
||||
| `rustup-version` | Version as reported by `rustup --version` |
|
||||
| `cachekey` | A short hash of the installed rustc version |
|
||||
|
||||
## Dependencies
|
||||
|
||||
The action works best on the GitHub-hosted runners, but can work on self-hosted ones too, provided the necessary dependencies are available.
|
||||
PRs to add support for more environments are welcome.
|
||||
|
||||
* bash 5
|
||||
* brew (macOS only)
|
||||
* rustup or curl
|
||||
* using other node actions
|
||||
|
||||
## License
|
||||
|
||||
The scripts and documentation in this project are released under the [MIT
|
||||
|
||||
20
action.yml
20
action.yml
@@ -38,6 +38,13 @@ inputs:
|
||||
cache-key:
|
||||
description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs."
|
||||
required: false
|
||||
cache-shared-key:
|
||||
description: "A cache key that is used instead of the automatic `job`-based key, and is stable over multiple jobs."
|
||||
required: false
|
||||
cache-bin:
|
||||
description: "Determines whether to cache ${CARGO_HOME}/bin."
|
||||
required: false
|
||||
default: "true"
|
||||
matcher:
|
||||
description: "Enable the Rust problem matcher"
|
||||
required: false
|
||||
@@ -123,13 +130,20 @@ runs:
|
||||
run: echo "::add-matcher::${{ github.action_path }}/rust.json"
|
||||
|
||||
- name: Install rustup, if needed
|
||||
if: runner.os != 'Windows'
|
||||
shell: bash
|
||||
run: |
|
||||
if ! command -v rustup &> /dev/null ; then
|
||||
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
|
||||
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
||||
|
||||
# Resolve the correct CARGO_HOME path depending on OS
|
||||
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
echo "${CARGO_HOME:-$USERPROFILE/.cargo}/bin" | sed 's|/|\\|g' >> $GITHUB_PATH
|
||||
else
|
||||
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
||||
fi
|
||||
fi
|
||||
env:
|
||||
RUNNER_OS: "${{ runner.os }}"
|
||||
|
||||
- name: rustup toolchain install ${{inputs.toolchain || 'stable'}}
|
||||
env:
|
||||
@@ -199,4 +213,6 @@ runs:
|
||||
workspaces: ${{inputs.cache-workspaces}}
|
||||
cache-directories: ${{inputs.cache-directories}}
|
||||
cache-on-failure: ${{inputs.cache-on-failure}}
|
||||
cache-bin: ${{inputs.cache-bin}}
|
||||
key: ${{inputs.cache-key}}
|
||||
shared-key: ${{inputs.cache-shared-key}}
|
||||
|
||||
Reference in New Issue
Block a user