Skip to content

Commit

Permalink
small code style improvements, README and CHANGELOG updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Swatinem committed Nov 6, 2022
1 parent ccdddcc commit e78327d
Show file tree
Hide file tree
Showing 7 changed files with 4,582 additions and 4,561 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Changelog

## 2.1.0

- Only hash `Cargo.{lock,toml}` files in the configured workspace directories.

## 2.0.2

- Avoid calling `cargo metadata` on pre-cleanup.
- Added `prefix-key`, `cache-directories` and `cache-targets` options.

## 2.0.1

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ sensible defaults.

- uses: Swatinem/rust-cache@v2
with:
# The prefix cache key, this can be changed to start a new cache manually
# The prefix cache key, this can be changed to start a new cache manually.
# default: "v0-rust"
prefix-key: ""

# An additional cache key that is stable over multiple jobs
# A cache key that is used instead of the automatic `job`-based key,
# and is stable over multiple jobs.
# default: empty
shared-key: ""

Expand All @@ -41,10 +42,11 @@ sensible defaults.
# default: ". -> target"
workspaces: ""

# Additional non workspace directories, separated by newlines
# Additional non workspace directories to be cached, separated by newlines.
cache-directories: ""

# Determines whether workspace `target` directories are cached.
# If `false`, only the cargo registry will be cached.
# default: "true"
cache-targets: ""

Expand Down
18 changes: 9 additions & 9 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@ description: "A GitHub Action that implements smart caching for rust/cargo proje
author: "Arpad Borsos <[email protected]>"
inputs:
prefix-key:
description: "The prefix cache key, this can be changed to start a new cache manually"
description: "The prefix cache key, this can be changed to start a new cache manually."
required: false
default: "v0-rust"
shared-key:
description: "An additional cache key that is stable over multiple jobs"
description: "A cache key that is used instead of the automatic `job`-based key, and is stable over multiple jobs."
required: false
key:
description: "An additional key for the cache"
description: "An additional cache key that is added alongside the automatic `job`-based cache key and can be used to further differentiate jobs."
required: false
env-vars:
description: "Additional environment variables to include in the cache key, separated by spaces"
description: "Additional environment variables to include in the cache key, separated by spaces."
required: false
workspaces:
description: "Paths to multiple Cargo workspaces and their target directories, separated by newlines"
description: "Paths to multiple Cargo workspaces and their target directories, separated by newlines."
required: false
cache-directories:
description: "Additional non workspace directories, separated by newlines"
description: "Additional non workspace directories to be cached, separated by newlines."
required: false
cache-targets:
description: "Determines whether workspace targets are cached"
description: "Determines whether workspace targets are cached. If `false`, only the cargo registry will be cached."
required: false
default: "true"
cache-on-failure:
description: "Cache even if the build fails. Defaults to false"
description: "Cache even if the build fails. Defaults to false."
required: false
outputs:
cache-hit:
description: "A boolean value that indicates an exact match was found"
description: "A boolean value that indicates an exact match was found."
runs:
using: "node16"
main: "dist/restore/index.js"
Expand Down
Loading

0 comments on commit e78327d

Please sign in to comment.