mirror of
https://github.com/actions/setup-java.git
synced 2026-08-11 01:29:28 +08:00
Handle early dependency cache failures during Java setup (#1226)
* Handle cache restore promise rejections Validate dependency cache providers before Java installation and settle cache restore failures immediately while preserving setup error precedence. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Make cache-rejection regression test deterministic Reject the cache restore only after it has started and while the Java installation is still pending, instead of relying on event-loop timing. Verified the test fails against the pre-fix implementation. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Validate cache input after required input checks Move the package-manager validation out of the top of run() so that missing java-version/java-version-file and toolchain id errors keep their original precedence. Validation now happens immediately before the cache restore is started, which still fails fast before any JDK download. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Co-authored-by: Bruno Borges <brborges@microsoft.com>
This commit is contained in:
Vendored
+5
-1
@@ -6,7 +6,8 @@ export const modules = {
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ restore: () => (/* binding */ restore)
|
||||
/* harmony export */ restore: () => (/* binding */ restore),
|
||||
/* harmony export */ validatePackageManager: () => (/* binding */ validatePackageManager)
|
||||
/* harmony export */ });
|
||||
/* unused harmony export save */
|
||||
/* harmony import */ var path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6928);
|
||||
@@ -108,6 +109,9 @@ function findPackageManager(id) {
|
||||
}
|
||||
return packageManager;
|
||||
}
|
||||
function validatePackageManager(id) {
|
||||
findPackageManager(id);
|
||||
}
|
||||
function resolveCachePaths(packageManager, cachePaths) {
|
||||
return cachePaths.length > 0 ? cachePaths : packageManager.path;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user