Include OS version in cache key when using cargo for builds

If we're running cargo, we need to add the runner name to the cache. Otherwise things that link
against system packages, like openssl, can break when we use the same cache across different
versions of the runner OS. For example, when going from Ubuntu 20.04 to 22.04, we move from OpenSSL
1.1.x to 3.x.
This commit is contained in:
Dave Rolsky
2024-12-24 11:09:14 -06:00
parent 718071590b
commit a183497a0a
4 changed files with 27 additions and 5 deletions

View File

@@ -4,8 +4,8 @@ The addition of caching is a significant behavior change for this action, so the
bumped to v1.0.0 because of this change.
- This action will now configure and use `Swatinem/rust-cache` by default for you. It will include
the `target` parameter as part of the cache key automatically. Suggested by @jennydaman (Jennings
Zhang). GH #23.
the `target` parameter as part of the cache key automatically, as well as the OS version when
using `cargo` on Linux. Suggested by @jennydaman (Jennings Zhang). GH #23.
- This action now validates its input and will exit early if they are not valid. GH #35.
- When compiling for `musl` targets, this action will not try to reinstall the `musl-tools` package
if it's already installed.