mirror of
https://code.forgejo.org/actions/setup-go
synced 2025-06-10 20:42:22 +02:00
Enable caching by default with default input (#332)
This commit is contained in:
parent
6b848af622
commit
c51a720768
9 changed files with 167 additions and 6269 deletions
20
dist/setup/index.js
vendored
20
dist/setup/index.js
vendored
|
@ -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.`);
|
||||
}
|
||||
|
@ -63605,7 +63614,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 (error) {
|
||||
core.warning(`Restore cache failed: ${error.message}`);
|
||||
}
|
||||
}
|
||||
// add problem matchers
|
||||
const matchersPath = path_1.default.join(__dirname, '../..', 'matchers.json');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue