Skip to content

Commit

Permalink
Do not abort build on restore cache error
Browse files Browse the repository at this point in the history
  • Loading branch information
dsame committed Feb 14, 2023
1 parent eced1f8 commit 1567e61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
7 changes: 6 additions & 1 deletion dist/setup/index.js
Expand Up @@ -63613,7 +63613,12 @@ function run() {
if (cache && cache_utils_1.isCacheFeatureAvailable()) {
const packageManager = 'default';
const cacheDependencyPath = core.getInput('cache-dependency-path');
yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath);
try {
yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath);
}
catch (e) {
core.warning(`Restore cache failed: ${e.message}`);
}
}
// add problem matchers
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
Expand Down
14 changes: 9 additions & 5 deletions src/main.ts
Expand Up @@ -62,11 +62,15 @@ export async function run() {
if (cache && isCacheFeatureAvailable()) {
const packageManager = 'default';
const cacheDependencyPath = core.getInput('cache-dependency-path');
await restoreCache(
parseGoVersion(goVersion),
packageManager,
cacheDependencyPath
);
try {
await restoreCache(
parseGoVersion(goVersion),
packageManager,
cacheDependencyPath
);
} catch (e) {
core.warning(`Restore cache failed: ${e.message}`)
}
}

// add problem matchers
Expand Down

0 comments on commit 1567e61

Please sign in to comment.