Do not abort build on restore cache error

This commit is contained in:
Sergey Dolin 2023-02-14 14:41:35 +01:00
parent 0cb66e4719
commit e1350d01c5
2 changed files with 15 additions and 6 deletions

5
dist/setup/index.js vendored
View file

@ -63611,8 +63611,13 @@ function run() {
if (cache && cache_utils_1.isCacheFeatureAvailable()) { if (cache && cache_utils_1.isCacheFeatureAvailable()) {
const packageManager = 'default'; const packageManager = 'default';
const cacheDependencyPath = core.getInput('cache-dependency-path'); const cacheDependencyPath = core.getInput('cache-dependency-path');
try {
yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath); yield cache_restore_1.restoreCache(parseGoVersion(goVersion), packageManager, cacheDependencyPath);
} }
catch (e) {
core.warning(`Restore cache failed: ${e.message}`);
}
}
// add problem matchers // add problem matchers
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json'); const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
core.info(`##[add-matcher]${matchersPath}`); core.info(`##[add-matcher]${matchersPath}`);

View file

@ -62,11 +62,15 @@ export async function run() {
if (cache && isCacheFeatureAvailable()) { if (cache && isCacheFeatureAvailable()) {
const packageManager = 'default'; const packageManager = 'default';
const cacheDependencyPath = core.getInput('cache-dependency-path'); const cacheDependencyPath = core.getInput('cache-dependency-path');
try {
await restoreCache( await restoreCache(
parseGoVersion(goVersion), parseGoVersion(goVersion),
packageManager, packageManager,
cacheDependencyPath cacheDependencyPath
); );
} catch (e) {
core.warning(`Restore cache failed: ${e.message}`)
}
} }
// add problem matchers // add problem matchers