A GitHub Action that implements smart caching for rust/cargo projects
Go to file
2020-11-07 10:22:23 +01:00
.github initial commit 2020-09-26 23:48:29 +02:00
dist update dependencies and rebuild 2020-11-07 10:22:23 +01:00
src deal with uncaught exceptions 2020-10-21 09:32:47 +02:00
.gitignore initial commit 2020-09-26 23:48:29 +02:00
action.yml merge all the caches and simplify 2020-10-03 18:39:38 +02:00
CHANGELOG.md Improve target pruning 2020-09-29 12:30:19 +02:00
package-lock.json update dependencies and rebuild 2020-11-07 10:22:23 +01:00
package.json update dependencies and rebuild 2020-11-07 10:22:23 +01:00
README.md merge all the caches and simplify 2020-10-03 18:39:38 +02:00
tsconfig.json update dependencies and rebuild 2020-11-07 10:22:23 +01:00

Rust Cache Action

A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.

Example usage

- uses: Swatinem/rust-cache@v1

Cache Details

The cache currently caches the following directories:

  • ~/.cargo/registry/index
  • ~/.cargo/registry/cache
  • ./target

This cache is automatically keyed by:

  • the github job,
  • the rustc release / host / hash, and
  • a hash of the Cargo.lock / Cargo.toml files.

An additional input key can be provided if the builtin keys are not sufficient.

Before persisting, the cache is cleaned of intermediate artifacts and anything that is not a workspace dependency. In particular, no caching of workspace crates will be done. For this reason, this action will automatically set CARGO_INCREMENTAL=0 to disable incremental compilation.

TODO: The ~/.cargo/git/db database is not yet persisted, support will be added at a later point.