mirror of
https://github.com/actions/setup-java.git
synced 2026-08-01 16:22:58 +00:00
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:
+7
-2
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user