mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 00:52:50 +00:00
Handle failure in cache-cleanup
Do not abort the remainder of the post-action on failure in cache-cleanup. Instead, just log a warning and continue. Fixes #858 Fixes #990
This commit is contained in:
parent
77699bae74
commit
a71aff6a12
5 changed files with 19 additions and 5 deletions
5
dist/main/index.js
vendored
5
dist/main/index.js
vendored
|
@ -93490,8 +93490,13 @@ function save(gradleUserHome, cacheListener, daemonController) {
|
|||
if ((0, cache_utils_1.isCacheCleanupEnabled)()) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
yield cacheCleaner.forceCleanup();
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
}
|
||||
}
|
||||
yield core.group('Caching Gradle state', () => __awaiter(this, void 0, void 0, function* () {
|
||||
return new cache_base_1.GradleStateCache(gradleUserHome).save(cacheListener);
|
||||
}));
|
||||
|
|
2
dist/main/index.js.map
vendored
2
dist/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
5
dist/post/index.js
vendored
5
dist/post/index.js
vendored
|
@ -93490,8 +93490,13 @@ function save(gradleUserHome, cacheListener, daemonController) {
|
|||
if ((0, cache_utils_1.isCacheCleanupEnabled)()) {
|
||||
core.info('Forcing cache cleanup.');
|
||||
const cacheCleaner = new cache_cleaner_1.CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']);
|
||||
try {
|
||||
yield cacheCleaner.forceCleanup();
|
||||
}
|
||||
catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`);
|
||||
}
|
||||
}
|
||||
yield core.group('Caching Gradle state', () => __awaiter(this, void 0, void 0, function* () {
|
||||
return new cache_base_1.GradleStateCache(gradleUserHome).save(cacheListener);
|
||||
}));
|
||||
|
|
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -90,7 +90,11 @@ export async function save(
|
|||
if (isCacheCleanupEnabled()) {
|
||||
core.info('Forcing cache cleanup.')
|
||||
const cacheCleaner = new CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']!)
|
||||
try {
|
||||
await cacheCleaner.forceCleanup()
|
||||
} catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`)
|
||||
}
|
||||
}
|
||||
|
||||
await core.group('Caching Gradle state', async () => {
|
||||
|
|
Loading…
Reference in a new issue