-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 99970e0
Showing
12 changed files
with
111,031 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
github: [Swatinem] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Rust Cache Action | ||
|
||
A GitHub Action that implements smart caching for rust/cargo projects | ||
|
||
## Inputs | ||
|
||
- `key` - An optional key for the `target` cache. This is useful in case you | ||
have different jobs for test / check / clippy, etc | ||
|
||
## Example usage | ||
|
||
```yaml | ||
- uses: Swatinem/rust-cache@v1 | ||
with: | ||
key: test | ||
``` | ||
## Specifics | ||
This action tries to be better than just caching the following directories: | ||
``` | ||
~/.cargo/registry | ||
~/.cargo/git | ||
target | ||
``` | ||
|
||
It disables incremental compilation and only caches dependencies. The | ||
assumption is that we will likely recompile the own crate(s) anyway. | ||
|
||
It also separates the cache into 4 groups, each treated differently: | ||
|
||
- Index: `~/.cargo/registry/index/<registry>`: | ||
|
||
This is always restored from its latest snapshot, and persisted based on the | ||
most recent revision. | ||
|
||
- Registry / Cache: `~/.cargo/registry/cache/<registry>`: | ||
|
||
Automatically keyed by the lockfile/toml hash, and is being pruned to only | ||
persist the dependencies that are being used. | ||
|
||
- Registry / Git: `~/.cargo/registry/git/<registry>`: | ||
|
||
Automatically keyed by the lockfile/toml hash. Pruning is still TODO. | ||
|
||
- target: `./target` | ||
|
||
Automatically keyed by the lockfile/toml hash, and is being pruned to only | ||
persist the dependencies that are being used. This is especially throwing | ||
away any intermediate artifacts. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Rust Cache" | ||
description: "A GitHub Action that implements smart caching for rust/cargo projects" | ||
author: "Arpad Borsos <[email protected]>" | ||
inputs: | ||
key: | ||
description: "An explicit key for restoring and saving the target cache" | ||
required: false | ||
runs: | ||
using: "node12" | ||
main: "dist/restore/index.js" | ||
post: "dist/save/index.js" | ||
post-if: "success()" | ||
branding: | ||
icon: "archive" | ||
color: "gray-dark" |
Oops, something went wrong.