This commit is contained in:
Dmitry Shibanov 2023-03-14 16:15:07 +01:00
parent 9c0b5f2c57
commit 90a3d02a0c
2 changed files with 23 additions and 5 deletions

23
dist/setup/index.js vendored
View file

@ -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,17 +63605,25 @@ 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');
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');
core.info(`##[add-matcher]${matchersPath}`);

View file

@ -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();