mirror of
https://github.com/Swatinem/rust-cache.git
synced 2024-11-26 17:56:08 +08:00
fix pretty printing and selftest
This commit is contained in:
parent
cb43a50800
commit
36af5cb1ae
4
.github/workflows/selftest.yml
vendored
4
.github/workflows/selftest.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
workspace-paths: tests
|
||||
workspaces: tests
|
||||
|
||||
- run: |
|
||||
cargo check
|
||||
@ -66,7 +66,7 @@ jobs:
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
workspace-paths: |
|
||||
workspaces: |
|
||||
tests
|
||||
tests/wasm-workspace
|
||||
|
||||
|
5
dist/restore/index.js
vendored
5
dist/restore/index.js
vendored
@ -61624,7 +61624,8 @@ async function getCmdOutput(cmd, args = [], options = {}) {
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
lib_core.error(stderr);
|
||||
lib_core.info(`[warning] Command failed: ${cmd} ${args.join(" ")}`);
|
||||
lib_core.info(`[warning] ${stderr}`);
|
||||
throw e;
|
||||
}
|
||||
return stdout;
|
||||
@ -61736,7 +61737,7 @@ class CacheConfig {
|
||||
self.keyRust = keyRust;
|
||||
// these prefixes should cover most of the compiler / rust / cargo keys
|
||||
const envPrefixes = ["CARGO", "CC", "CXX", "CMAKE", "RUST"];
|
||||
envPrefixes.push(...lib_core.getInput("envVars").split(/\s+/));
|
||||
envPrefixes.push(...lib_core.getInput("envVars").split(/\s+/).filter(Boolean));
|
||||
// sort the available env vars so we have a more stable hash
|
||||
const keyEnvs = [];
|
||||
const envKeys = Object.keys(process.env);
|
||||
|
8
dist/save/index.js
vendored
8
dist/save/index.js
vendored
@ -61624,7 +61624,8 @@ async function getCmdOutput(cmd, args = [], options = {}) {
|
||||
});
|
||||
}
|
||||
catch (e) {
|
||||
core.error(stderr);
|
||||
core.info(`[warning] Command failed: ${cmd} ${args.join(" ")}`);
|
||||
core.info(`[warning] ${stderr}`);
|
||||
throw e;
|
||||
}
|
||||
return stdout;
|
||||
@ -61736,7 +61737,7 @@ class CacheConfig {
|
||||
self.keyRust = keyRust;
|
||||
// these prefixes should cover most of the compiler / rust / cargo keys
|
||||
const envPrefixes = ["CARGO", "CC", "CXX", "CMAKE", "RUST"];
|
||||
envPrefixes.push(...core.getInput("envVars").split(/\s+/));
|
||||
envPrefixes.push(...core.getInput("envVars").split(/\s+/).filter(Boolean));
|
||||
// sort the available env vars so we have a more stable hash
|
||||
const keyEnvs = [];
|
||||
const envKeys = Object.keys(process.env);
|
||||
@ -62024,6 +62025,8 @@ async function run() {
|
||||
}
|
||||
// TODO: remove this once https://github.com/actions/toolkit/pull/553 lands
|
||||
await macOsWorkaround();
|
||||
core.info(`# Cleaning Cache`);
|
||||
config.printInfo();
|
||||
const registryName = await getRegistryName(config);
|
||||
const allPackages = [];
|
||||
for (const workspace of config.workspaces) {
|
||||
@ -62057,7 +62060,6 @@ async function run() {
|
||||
core.info(`[warning] ${e.stack}`);
|
||||
}
|
||||
core.info(`# Saving cache`);
|
||||
config.printInfo();
|
||||
await cache.saveCache(config.cachePaths, config.cacheKey);
|
||||
}
|
||||
catch (e) {
|
||||
|
@ -30,6 +30,9 @@ async function run() {
|
||||
// TODO: remove this once https://github.com/actions/toolkit/pull/553 lands
|
||||
await macOsWorkaround();
|
||||
|
||||
core.info(`# Cleaning Cache`);
|
||||
config.printInfo();
|
||||
|
||||
const registryName = await getRegistryName(config);
|
||||
|
||||
const allPackages = [];
|
||||
@ -64,7 +67,6 @@ async function run() {
|
||||
}
|
||||
|
||||
core.info(`# Saving cache`);
|
||||
config.printInfo();
|
||||
await cache.saveCache(config.cachePaths, config.cacheKey);
|
||||
} catch (e) {
|
||||
core.info(`[warning] ${(e as any).stack}`);
|
||||
|
@ -22,7 +22,8 @@ export async function getCmdOutput(
|
||||
...options,
|
||||
});
|
||||
} catch (e) {
|
||||
core.error(stderr);
|
||||
core.info(`[warning] Command failed: ${cmd} ${args.join(" ")}`);
|
||||
core.info(`[warning] ${stderr}`);
|
||||
throw e;
|
||||
}
|
||||
return stdout;
|
||||
|
Loading…
Reference in New Issue
Block a user