3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-04-29 14:45:53 +00:00

Cache-on-failure support (#22)

This commit is contained in:
Tom Parker-Shemilt 2021-06-28 22:18:07 +01:00 committed by GitHub
parent 842ef286ff
commit 536c94f32c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 2 deletions

View file

@ -9,6 +9,9 @@ import path from "path";
process.on("uncaughtException", (e) => {
core.info(`[warning] ${e.message}`);
if (e.stack) {
core.info(e.stack)
}
});
const cwd = core.getInput("working-directory");

View file

@ -4,6 +4,11 @@ import { cleanTarget, getCacheConfig, getCargoBins, getPackages, stateBins, stat
async function run() {
try {
var cacheOnFailure = core.getInput("cache-on-failure").toLowerCase()
if (cacheOnFailure !== "true") {
cacheOnFailure = "false"
}
core.exportVariable("CACHE_ON_FAILURE", cacheOnFailure)
core.exportVariable("CARGO_INCREMENTAL", 0);
const { paths, key, restoreKeys } = await getCacheConfig();