Add setup orchestration tests (#1163)

Make the setup entrypoint import-safe and cover its validation, installation sequencing, post-install collaborators, caching, and failure handling directly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: a5ba8975-a9ac-4d2c-b41d-97c99689d1bd
This commit is contained in:
Bruno Borges
2026-07-29 00:36:12 -04:00
committed by GitHub
parent 5894ef6b27
commit 6e26972896
3 changed files with 430 additions and 3 deletions
+7 -2
View File
@@ -16,7 +16,7 @@ import {JavaInstallerOptions} from './distributions/base-models.js';
import {configureMavenArgs} from './maven-args.js';
import {configureProblemMatcher} from './problem-matcher.js';
async function run() {
export async function run() {
try {
const versions = core.getMultilineInput(constants.INPUT_JAVA_VERSION);
let distributionName = core.getInput(constants.INPUT_DISTRIBUTION);
@@ -139,7 +139,12 @@ async function run() {
}
}
run();
if (process.argv[1] === fileURLToPath(import.meta.url)) {
run();
} else {
// https://nodejs.org/api/modules.html#modules_accessing_the_main_module
core.info('the script is loaded as a module, so skipping the execution');
}
function getJdkFileInput(): string {
const jdkFile = core.getInput(constants.INPUT_JDK_FILE);