Skip to content

Commit 1ccdce0

Browse files
Don't use the tool cache on GitHub-hosted runners by default
This introduces performance problems due to deficiencies in the filesystem layout of GitHub-hosted runners; see #34. The tool cache isn't very useful on such runners anyway, but I've added an option to override the default. Also add some more logging (related: #45). Resolves: #34
1 parent 4dec2c5 commit 1ccdce0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

post.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ async function main() {
1818
}
1919

2020
if (accessible) {
21+
core.info('Checking cache size');
2122
const size = await totalSize(cache_path);
2223
const size_limit = core.getInput('cache-size-limit') * 1024 * 1024; // MiB -> bytes
2324
if (size_limit !== 0 && size > size_limit) {
@@ -26,10 +27,13 @@ async function main() {
2627
// remove the old cache entries, so we instead want to save an empty cache directory.
2728
// To do this, delete all the contents of the cache directory before saving the cache.
2829
await rmDirContents(cache_path);
30+
} else {
31+
core.info(`Cache directory is ${size} bytes, below limit of ${size_limit} bytes; keeping intact`);
2932
}
3033

3134
const prefix = await common.getCachePrefix();
3235
const name = prefix + github.context.runId;
36+
core.info('Saving Zig cache');
3337
await cache.saveCache([cache_path], name);
3438
}
3539
}

0 commit comments

Comments
 (0)