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:
parent
842ef286ff
commit
536c94f32c
5 changed files with 18 additions and 2 deletions
|
@ -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");
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue