Skip to content

Commit 33b85c3

Browse files
authored
Merge pull request #65 from mindrunner/main
2 parents 9d7e65c + 82947d7 commit 33b85c3

File tree

2 files changed

+30
-24
lines changed

2 files changed

+30
-24
lines changed

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Caching for Rust tools and build artifacts is enabled.
66
Environment variables are set to optimize the cache hits.
77
[Problem Matchers] are provided for build messages (cargo, clippy) and formatting (rustfmt).
88

9-
The action is heavily inspired by *dtolnay*'s <https://github.com/dtolnay/rust-toolchain> and extends it with further features.
9+
The action is heavily inspired by _dtolnay_'s <https://github.com/dtolnay/rust-toolchain> and extends it with further features.
1010

1111
## Example workflow
1212

@@ -48,21 +48,22 @@ If no `toolchain` value or toolchain file is present, it will default to `stable
4848
First, all items specified in the toolchain file are installed.
4949
Afterward, the `components` and `target` specified via inputs are installed in addition to the items from the toolchain file.
5050

51-
| Name | Description | Default |
52-
| ------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------- |
53-
| `toolchain` | Comma-separated list of Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. The last version is the default. | stable |
54-
| `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | |
55-
| `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | |
56-
| `cache` | Automatically configure Rust cache (using [`Swatinem/rust-cache`]) | true |
57-
| `cache-directories` | Propagates the value to [`Swatinem/rust-cache`] | |
58-
| `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | |
59-
| `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true |
60-
| `cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `key` | |
61-
| `cache-shared-key` | Propagates the value to [`Swatinem/rust-cache`] as `shared-key` | |
62-
| `cache-bin` | Propagates the value to [`Swatinem/rust-cache`] as `cache-bin` | true |
63-
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
64-
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
65-
| `override` | Setup the last installed toolchain as the default via `rustup override` | true |
51+
| Name | Description | Default |
52+
| ------------------- | ----------------------------------------------------------------------------------------------------------------------- | ------------- |
53+
| `toolchain` | Comma-separated list of Rustup toolchain specifier e.g. `stable`, `nightly`, `1.42.0`. The last version is the default. | stable |
54+
| `target` | Additional target support to install e.g. `wasm32-unknown-unknown` | |
55+
| `components` | Comma-separated string of additional components to install e.g. `clippy, rustfmt` | |
56+
| `cache` | Automatically configure Rust cache (using [`Swatinem/rust-cache`]) | true |
57+
| `cache-directories` | Propagates the value to [`Swatinem/rust-cache`] | |
58+
| `cache-workspaces` | Propagates the value to [`Swatinem/rust-cache`] | |
59+
| `cache-on-failure` | Propagates the value to [`Swatinem/rust-cache`] | true |
60+
| `cache-key` | Propagates the value to [`Swatinem/rust-cache`] as `key` | |
61+
| `cache-shared-key` | Propagates the value to [`Swatinem/rust-cache`] as `shared-key` | |
62+
| `cache-bin` | Propagates the value to [`Swatinem/rust-cache`] as `cache-bin` | true |
63+
| `cache-provider` | Propagates the value to [`Swatinem/rust-cache`] as `cache-provider` | 'github' |
64+
| `matcher` | Enable problem matcher to surface build messages and formatting issues | true |
65+
| `rustflags` | Set the value of `RUSTFLAGS` (set to empty string to avoid overwriting existing flags) | "-D warnings" |
66+
| `override` | Setup the last installed toolchain as the default via `rustup override` | true |
6667

6768
[`Swatinem/rust-cache`]: https://github.com/Swatinem/rust-cache
6869

@@ -71,10 +72,10 @@ Afterward, the `components` and `target` specified via inputs are installed in a
7172
By default, this action sets the `RUSTFLAGS` environment variable to `-D warnings`.
7273
However, rustflags sources are mutually exclusive, so setting this environment variable omits any configuration through `target.*.rustflags` or `build.rustflags`.
7374

74-
* If `RUSTFLAGS` is already set, no modifications of the variable are made and the original value remains.
75-
* If `RUSTFLAGS` is unset and the `rustflags` input is empty (i.e., the empty string), then it will remain unset.
76-
Use this, if you want to prevent the value from being set because you make use of `target.*.rustflags` or `build.rustflags`.
77-
* Otherwise, the environment variable `RUSTFLAGS` is set to the content of `rustflags`.
75+
- If `RUSTFLAGS` is already set, no modifications of the variable are made and the original value remains.
76+
- If `RUSTFLAGS` is unset and the `rustflags` input is empty (i.e., the empty string), then it will remain unset.
77+
Use this, if you want to prevent the value from being set because you make use of `target.*.rustflags` or `build.rustflags`.
78+
- Otherwise, the environment variable `RUSTFLAGS` is set to the content of `rustflags`.
7879

7980
To prevent this from happening, set the `rustflags` input to an empty string, which will
8081
prevent the action from setting `RUSTFLAGS` at all, keeping any existing preferences.
@@ -95,10 +96,10 @@ You can read more rustflags, and their load order, in the [Cargo reference].
9596
The action works best on the GitHub-hosted runners, but can work on self-hosted ones too, provided the necessary dependencies are available.
9697
PRs to add support for more environments are welcome.
9798

98-
* bash 5
99-
* brew (macOS only)
100-
* rustup or curl
101-
* using other node actions
99+
- bash 5
100+
- brew (macOS only)
101+
- rustup or curl
102+
- using other node actions
102103

103104
## License
104105

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ inputs:
4545
description: "Determines whether to cache ${CARGO_HOME}/bin."
4646
required: false
4747
default: "true"
48+
cache-provider:
49+
description: "Determines which provider to use for caching. Options are github or buildjet, defaults to github."
50+
required: false
51+
default: "github"
4852
matcher:
4953
description: "Enable the Rust problem matcher"
5054
required: false
@@ -214,5 +218,6 @@ runs:
214218
cache-directories: ${{inputs.cache-directories}}
215219
cache-on-failure: ${{inputs.cache-on-failure}}
216220
cache-bin: ${{inputs.cache-bin}}
221+
cache-provider: ${{inputs.cache-provider}}
217222
key: ${{inputs.cache-key}}
218223
shared-key: ${{inputs.cache-shared-key}}

0 commit comments

Comments
 (0)