Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
359a70e43a | ||
|
|
ecee04e7b3 |
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2.2.0
|
||||||
|
|
||||||
|
- Add new `save-if` option to always restore, but only conditionally save the cache.
|
||||||
|
|
||||||
## 2.1.0
|
## 2.1.0
|
||||||
|
|
||||||
- Only hash `Cargo.{lock,toml}` files in the configured workspace directories.
|
- Only hash `Cargo.{lock,toml}` files in the configured workspace directories.
|
||||||
|
|||||||
@@ -53,6 +53,12 @@ sensible defaults.
|
|||||||
# Determines if the cache should be saved even when the workflow has failed.
|
# Determines if the cache should be saved even when the workflow has failed.
|
||||||
# default: "false"
|
# default: "false"
|
||||||
cache-on-failure: ""
|
cache-on-failure: ""
|
||||||
|
|
||||||
|
# Determiners whether the cache should be saved.
|
||||||
|
# If `false`, the cache is only restored.
|
||||||
|
# Useful for jobs where the matrix is additive e.g. additional Cargo features.
|
||||||
|
# default: "true"
|
||||||
|
save-if: ""
|
||||||
```
|
```
|
||||||
|
|
||||||
Further examples are available in the [.github/workflows](./.github/workflows/) directory.
|
Further examples are available in the [.github/workflows](./.github/workflows/) directory.
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ inputs:
|
|||||||
cache-on-failure:
|
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
|
required: false
|
||||||
|
save-if:
|
||||||
|
description: "Determiners whether the cache should be saved. If `false`, the cache is only restored."
|
||||||
|
required: false
|
||||||
|
default: "true"
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit:
|
cache-hit:
|
||||||
description: "A boolean value that indicates an exact match was found."
|
description: "A boolean value that indicates an exact match was found."
|
||||||
|
|||||||
3
dist/save/index.js
vendored
3
dist/save/index.js
vendored
@@ -64922,7 +64922,8 @@ process.on("uncaughtException", (e) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
async function run() {
|
async function run() {
|
||||||
if (!cache.isFeatureAvailable()) {
|
const save = core.getInput("save-if").toLowerCase() || "true";
|
||||||
|
if (!(cache.isFeatureAvailable() && save === "true")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "rust-cache",
|
"name": "rust-cache",
|
||||||
"version": "2.1.0",
|
"version": "2.2.0",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"version": "2.1.0",
|
"version": "2.2.0",
|
||||||
"license": "LGPL-3.0",
|
"license": "LGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.0.6",
|
"@actions/cache": "^3.0.6",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "rust-cache",
|
"name": "rust-cache",
|
||||||
"version": "2.1.0",
|
"version": "2.2.0",
|
||||||
"description": "A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.",
|
"description": "A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"actions",
|
"actions",
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ process.on("uncaughtException", (e) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
if (!cache.isFeatureAvailable()) {
|
const save = core.getInput("save-if").toLowerCase() || "true";
|
||||||
|
|
||||||
|
if (!(cache.isFeatureAvailable() && save === "true")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user