All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Fix problem matcher for rustfmt output. The format has changed since rust-lang/rustfmt#5971 and now follows the form "filename:line". Thanks to @0xcypher02 for pointing out the problem.
- Add new parameter
cache-directories
that is propagated toSwatinem/rust-cache
(#44 by @pranc1ngpegasus) - Add new parameter
cache-key
that is propagated toSwatinem/rust-cache
askey
(#41 by @iainlane) - Make rustup toolchain installation more robust in light of planned changes rust-lang/rustup#3635 and rust-lang/rustup#3985
- Allow installing multiple Rust toolchains by specifying multiple versions in the
toolchain
input parameter. - Configure the
rustup override
behavior via the newoverride
input. (#38)
- Add extra argument
cache-on-failure
and forward it toSwatinem/rust-cache
. (#39 by @samuelhnrq)
Set the default the value to true. This will result in more caching than previously. This helps when large dependencies are compiled only for testing to fail.
- Allow specifying subdirectories for cache.
- Fix toolchain file overriding.
- Allow overriding the toolchain file with explicit
toolchain
input. (#26)
- Allow disabling problem matchers (#27) This can be useful when having a matrix of jobs, that produce the same errors.
-
Support installing additional components and targets that are not listed in
rust-toolchain
(#14) Before only the items listed inrust-toolchain
were installed. Now all the items from the toolchain file are installed and then all thetarget
s andcomponents
that are provided as action inputs. This allows installing extra tools only for CI or simplify testing special targets in CI. -
Allow skipping the creation of a
RUSTFLAGS
environment variable. Cargos logic for rustflags is complicated, and setting theRUSTFLAGS
environment variable prevents other ways of working. Provide a newrustflags
input, which controls the environment variable creation. If the value is set to the empty string, thenRUSTFLAGS
is not created.Pre-existing
RUSTFLAGS
variables are never modified by this extension.
- Use color aware problem matcher. The problem matcher currently runs against the colored terminal output (Bug 1, Bug 2). The previous matcher was not aware of ANSII color codes and did not work.
- Executing the action twice for different toolchains now no longer fails around unstable features #12. If multiple toolchains are installed, the "CARGO_REGISTRIES_CRATES_IO_PROTOCOL" can be downgraded to "git" if any of the installed toolchains require it.
- Tweak sparse registry version regex to better work with 1.68 nightly versions.
- Fix command not found issue
-
Fixed running on macOS #9 #10 The macOS images have an ancient version of bash, but the action relies on "newer" features than 2014. We install bash via brew (already pre-installed) to have a new enough version.
The CI is extended to also run on Windows and macOS to catch such issues earlier in the future.
Thanks to @GeorgeHahn for reporting the issue.
- Only set environment variables, if they are not set before. This allows setting environment variables before using this action and keeping their values.
- Enable stable sparse registry, except on versions 1.66 and 1.67 where this leads to errors.
- Disable the stable access to the sparse registry. Setting the value causes problem on version before stabilization, e.g., 1.67. For example, "cargo add" fails.
- The the correct environment variable to enable the sparse registry access.
The pull request originally had the wrong value, without
CARGO_
prefix.
- Use the newly stabilized setting to enable sparse registry access. This speeds up access to the crate registry and is in addition to the unstable nightly env var. rust-lang/cargo#11224
- The last version did not fix all "set-output" commands
- Switch from set-output to $GITHUB_OUTPUT to avoid warning https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
- Fix setting
$CARGO_HOME
to a valid path, in case rustup is installed from the internet. Thanks to @nahsi for providing the fix.
- Use the sparse-registry on nightly for faster access to the crate registry on nightly. https://internals.rust-lang.org/t/call-for-testing-cargo-sparse-registry/16862
- An option to disable configuring Rust cache. Thanks to @filips123 for the PR.
- Set environment variables before invoking the cache action. This ensures restoring and saving are using the same cache key.
- Prefer toolchain definitions in
rust-toolchain
orrust-toolchain.toml
files (Toolchain File). Other input values are ignored if either file is found.
- Install rustup if not available in the CI environment. (Linux only) The code is taken from this issue: dtolnay/rust-toolchain#8
- Add rustc version output suitable as a cache key. This is based on dtolnay/rust-toolchain#20 and dtolnay/rust-toolchain#17.
- Update to
Swatinem/rust-cache@v2
.
- Enable colored cargo output.
- Print short backtraces during test failure.
- Release action on marketplace
Initial Version