diff --git a/dist/setup/index.js b/dist/setup/index.js index 0864b68..f298d5c 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -63130,8 +63130,17 @@ const getPackageManagerInfo = (packageManager) => __awaiter(void 0, void 0, void }); exports.getPackageManagerInfo = getPackageManagerInfo; const getCacheDirectoryPath = (packageManagerInfo) => __awaiter(void 0, void 0, void 0, function* () { - const pathList = yield Promise.all(packageManagerInfo.cacheFolderCommandList.map((command) => __awaiter(void 0, void 0, void 0, function* () { return exports.getCommandOutput(command); }))); - const cachePaths = pathList.filter(item => item); + const pathOutputs = yield Promise.allSettled(packageManagerInfo.cacheFolderCommandList.map((command) => __awaiter(void 0, void 0, void 0, function* () { return exports.getCommandOutput(command); }))); + const results = pathOutputs.map(item => { + if (item.status === 'fulfilled') { + return item.value; + } + else { + core.info(`[warning]getting cache directory path failed: ${item.reason}`); + } + return ''; + }); + const cachePaths = results.filter(item => item); if (!cachePaths.length) { throw new Error(`Could not get cache folder paths.`); } @@ -63596,16 +63605,24 @@ function run() { core.info('Setting GOROOT for Go version < 1.9'); core.exportVariable('GOROOT', installDir); } + core.info(`Successfully set up Go version ${versionSpec}`); + } + else { + core.info('[warning]go-version input was not specified. The action will try to use pre-installed version.'); } const added = yield addBinToPath(); core.debug(`add bin ${added}`); - core.info(`Successfully set up Go version ${versionSpec}`); const goPath = yield io.which('go'); const goVersion = (child_process_1.default.execSync(`${goPath} version`) || '').toString(); 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 (error) { + core.warning(`Restore cache failed: ${error.message}`); + } } // add problem matchers const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json'); diff --git a/src/main.ts b/src/main.ts index 06b7c3d..b576f0b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -50,6 +50,8 @@ export async function run() { core.info('Setting GOROOT for Go version < 1.9'); core.exportVariable('GOROOT', installDir); } + + core.info(`Successfully set up Go version ${versionSpec}`); } else { core.info( '[warning]go-version input was not specified. The action will try to use pre-installed version.' @@ -58,7 +60,6 @@ export async function run() { const added = await addBinToPath(); core.debug(`add bin ${added}`); - core.info(`Successfully set up Go version ${versionSpec}`); const goPath = await io.which('go'); const goVersion = (cp.execSync(`${goPath} version`) || '').toString();