Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 36af5cb

Browse files
committed
fix pretty printing and selftest
1 parent cb43a50 commit 36af5cb

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

.github/workflows/selftest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
2222
- uses: ./
2323
with:
24-
workspace-paths: tests
24+
workspaces: tests
2525

2626
- run: |
2727
cargo check
@@ -66,7 +66,7 @@ jobs:
6666
6767
- uses: ./
6868
with:
69-
workspace-paths: |
69+
workspaces: |
7070
tests
7171
tests/wasm-workspace
7272

dist/restore/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61624,7 +61624,8 @@ async function getCmdOutput(cmd, args = [], options = {}) {
6162461624
});
6162561625
}
6162661626
catch (e) {
61627-
lib_core.error(stderr);
61627+
lib_core.info(`[warning] Command failed: ${cmd} ${args.join(" ")}`);
61628+
lib_core.info(`[warning] ${stderr}`);
6162861629
throw e;
6162961630
}
6163061631
return stdout;
@@ -61736,7 +61737,7 @@ class CacheConfig {
6173661737
self.keyRust = keyRust;
6173761738
// these prefixes should cover most of the compiler / rust / cargo keys
6173861739
const envPrefixes = ["CARGO", "CC", "CXX", "CMAKE", "RUST"];
61739-
envPrefixes.push(...lib_core.getInput("envVars").split(/\s+/));
61740+
envPrefixes.push(...lib_core.getInput("envVars").split(/\s+/).filter(Boolean));
6174061741
// sort the available env vars so we have a more stable hash
6174161742
const keyEnvs = [];
6174261743
const envKeys = Object.keys(process.env);

dist/save/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61624,7 +61624,8 @@ async function getCmdOutput(cmd, args = [], options = {}) {
6162461624
});
6162561625
}
6162661626
catch (e) {
61627-
core.error(stderr);
61627+
core.info(`[warning] Command failed: ${cmd} ${args.join(" ")}`);
61628+
core.info(`[warning] ${stderr}`);
6162861629
throw e;
6162961630
}
6163061631
return stdout;
@@ -61736,7 +61737,7 @@ class CacheConfig {
6173661737
self.keyRust = keyRust;
6173761738
// these prefixes should cover most of the compiler / rust / cargo keys
6173861739
const envPrefixes = ["CARGO", "CC", "CXX", "CMAKE", "RUST"];
61739-
envPrefixes.push(...core.getInput("envVars").split(/\s+/));
61740+
envPrefixes.push(...core.getInput("envVars").split(/\s+/).filter(Boolean));
6174061741
// sort the available env vars so we have a more stable hash
6174161742
const keyEnvs = [];
6174261743
const envKeys = Object.keys(process.env);
@@ -62024,6 +62025,8 @@ async function run() {
6202462025
}
6202562026
// TODO: remove this once https://github.com/actions/toolkit/pull/553 lands
6202662027
await macOsWorkaround();
62028+
core.info(`# Cleaning Cache`);
62029+
config.printInfo();
6202762030
const registryName = await getRegistryName(config);
6202862031
const allPackages = [];
6202962032
for (const workspace of config.workspaces) {
@@ -62057,7 +62060,6 @@ async function run() {
6205762060
core.info(`[warning] ${e.stack}`);
6205862061
}
6205962062
core.info(`# Saving cache`);
62060-
config.printInfo();
6206162063
await cache.saveCache(config.cachePaths, config.cacheKey);
6206262064
}
6206362065
catch (e) {

src/save.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ async function run() {
3030
// TODO: remove this once https://github.com/actions/toolkit/pull/553 lands
3131
await macOsWorkaround();
3232

33+
core.info(`# Cleaning Cache`);
34+
config.printInfo();
35+
3336
const registryName = await getRegistryName(config);
3437

3538
const allPackages = [];
@@ -64,7 +67,6 @@ async function run() {
6467
}
6568

6669
core.info(`# Saving cache`);
67-
config.printInfo();
6870
await cache.saveCache(config.cachePaths, config.cacheKey);
6971
} catch (e) {
7072
core.info(`[warning] ${(e as any).stack}`);

src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export async function getCmdOutput(
2222
...options,
2323
});
2424
} catch (e) {
25-
core.error(stderr);
25+
core.info(`[warning] Command failed: ${cmd} ${args.join(" ")}`);
26+
core.info(`[warning] ${stderr}`);
2627
throw e;
2728
}
2829
return stdout;

0 commit comments

Comments
 (0)