mirror of
https://github.com/actions/setup-java.git
synced 2026-07-08 22:31:49 +00:00
Compare commits
No commits in common. "main" and "v5.5.0" have entirely different histories.
6
.eslintignore
Normal file
6
.eslintignore
Normal file
@ -0,0 +1,6 @@
|
||||
# Ignore list
|
||||
/*
|
||||
|
||||
# Do not ignore these folders:
|
||||
!__tests__/
|
||||
!src/
|
||||
51
.eslintrc.js
Normal file
51
.eslintrc.js
Normal file
@ -0,0 +1,51 @@
|
||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||
module.exports = {
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:eslint-plugin-jest/recommended',
|
||||
'eslint-config-prettier'
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint', 'eslint-plugin-node', 'eslint-plugin-jest'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-require-imports': 'error',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
'error',
|
||||
{
|
||||
'ts-ignore': 'allow-with-description'
|
||||
}
|
||||
],
|
||||
'no-console': 'error',
|
||||
'yoda': 'error',
|
||||
'prefer-const': [
|
||||
'error',
|
||||
{
|
||||
destructuring: 'all'
|
||||
}
|
||||
],
|
||||
'no-control-regex': 'off',
|
||||
'no-constant-condition': ['error', {checkLoops: false}],
|
||||
'node/no-extraneous-import': 'error'
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['**/*{test,spec}.ts'],
|
||||
rules: {
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'jest/no-standalone-expect': 'off',
|
||||
'jest/no-conditional-expect': 'off',
|
||||
'no-console': 'off',
|
||||
|
||||
}
|
||||
}
|
||||
],
|
||||
env: {
|
||||
node: true,
|
||||
es6: true,
|
||||
'jest/globals': true
|
||||
}
|
||||
};
|
||||
13
.github/java.json
vendored
13
.github/java.json
vendored
@ -21,19 +21,6 @@
|
||||
"message": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"owner": "maven-javac",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^\\[(WARNING|ERROR)\\]\\s+(.+?\\.java):\\[(\\d+),(\\d+)\\]\\s+(.+)$",
|
||||
"severity": 1,
|
||||
"file": 2,
|
||||
"line": 3,
|
||||
"column": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
5
.github/workflows/e2e-local-file.yml
vendored
5
.github/workflows/e2e-local-file.yml
vendored
@ -47,7 +47,7 @@ jobs:
|
||||
id: setup-java
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdk-file: ${{ runner.temp }}/${{ env.LocalFilename }}
|
||||
jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
|
||||
java-version: '11.0.0-ea'
|
||||
architecture: x64
|
||||
- name: Verify Java version
|
||||
@ -88,7 +88,7 @@ jobs:
|
||||
id: setup-java
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdk-file: ${{ runner.temp }}/${{ env.LocalFilename }}
|
||||
jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
|
||||
java-version: '11.0.0-ea'
|
||||
architecture: x64
|
||||
- name: Verify Java version
|
||||
@ -129,7 +129,6 @@ jobs:
|
||||
id: setup-java
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
# Intentionally uses the deprecated `jdkFile` alias to keep it covered.
|
||||
jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
|
||||
java-version: '11.0.0-ea'
|
||||
architecture: x64
|
||||
|
||||
@ -10,11 +10,8 @@ allowed:
|
||||
- mit
|
||||
- cc0-1.0
|
||||
- unlicense
|
||||
- blueoak-1.0.0
|
||||
|
||||
reviewed:
|
||||
npm:
|
||||
- "@actions/http-client" # MIT (license text present), but detected as "other"
|
||||
- "argparse" # Python Software Foundation License (PSF), but detected as "other"
|
||||
- "balanced-match"
|
||||
- "brace-expansion"
|
||||
|
||||
BIN
.licenses/npm/@actions/cache.dep.yml
generated
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/core.dep.yml
generated
BIN
.licenses/npm/@actions/core.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/exec.dep.yml
generated
BIN
.licenses/npm/@actions/exec.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/glob-0.7.0.dep.yml
generated
BIN
.licenses/npm/@actions/glob-0.7.0.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@actions/http-client.dep.yml
generated
BIN
.licenses/npm/@actions/http-client.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/io.dep.yml
generated
BIN
.licenses/npm/@actions/io.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/tool-cache.dep.yml
generated
BIN
.licenses/npm/@actions/tool-cache.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/core-client.dep.yml
generated
BIN
.licenses/npm/@azure/core-client.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-http-compat.dep.yml
generated
BIN
.licenses/npm/@azure/core-http-compat.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-rest-pipeline.dep.yml
generated
BIN
.licenses/npm/@azure/core-rest-pipeline.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-xml.dep.yml
generated
BIN
.licenses/npm/@azure/core-xml.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/storage-common.dep.yml
generated
BIN
.licenses/npm/@azure/storage-common.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@typespec/ts-http-runtime.dep.yml
generated
BIN
.licenses/npm/@typespec/ts-http-runtime.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/anynum.dep.yml
generated
BIN
.licenses/npm/anynum.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/balanced-match-4.0.4.dep.yml
generated
BIN
.licenses/npm/balanced-match-4.0.4.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/brace-expansion-5.0.7.dep.yml
generated
BIN
.licenses/npm/brace-expansion-5.0.7.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/fast-xml-builder.dep.yml
generated
BIN
.licenses/npm/fast-xml-builder.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/fast-xml-parser.dep.yml
generated
BIN
.licenses/npm/fast-xml-parser.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/js-yaml.dep.yml
generated
BIN
.licenses/npm/js-yaml.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/minimatch-10.2.5.dep.yml
generated
BIN
.licenses/npm/minimatch-10.2.5.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/path-expression-matcher.dep.yml
generated
BIN
.licenses/npm/path-expression-matcher.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/semver-6.3.1.dep.yml
generated
Normal file
BIN
.licenses/npm/semver-6.3.1.dep.yml
generated
Normal file
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/strnum.dep.yml
generated
BIN
.licenses/npm/strnum.dep.yml
generated
Binary file not shown.
11
.prettierrc.js
Normal file
11
.prettierrc.js
Normal file
@ -0,0 +1,11 @@
|
||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||
module.exports = {
|
||||
printWidth: 80,
|
||||
tabWidth: 2,
|
||||
useTabs: false,
|
||||
semi: true,
|
||||
singleQuote: true,
|
||||
trailingComma: 'none',
|
||||
bracketSpacing: false,
|
||||
arrowParens: 'avoid'
|
||||
};
|
||||
@ -1,10 +0,0 @@
|
||||
{
|
||||
"printWidth": 80,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"bracketSpacing": false,
|
||||
"arrowParens": "avoid"
|
||||
}
|
||||
12
README.md
12
README.md
@ -18,10 +18,6 @@ The `setup-java` action provides the following functionality for GitHub Actions
|
||||
|
||||
This action allows you to work with Java and Scala projects.
|
||||
|
||||
## Breaking changes in V6
|
||||
|
||||
- **Migrated to ESM** to enable support for the latest `@actions/*` package versions.
|
||||
|
||||
## Breaking changes in V5
|
||||
|
||||
- Upgraded action from node20 to node24
|
||||
@ -37,11 +33,11 @@ For more details, see the full release notes on the [releases page](https://git
|
||||
|
||||
- `distribution`: Java [distribution](#supported-distributions). Required unless `java-version-file` points to `.sdkmanrc` with a recognized distribution suffix (for example `java=21.0.5-tem`).
|
||||
|
||||
- `java-package`: The packaging variant of the chosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. For Azul Zulu, `jdk+crac` and `jre+crac` are also supported. Default value: `jdk`.
|
||||
- `java-package`: The packaging variant of the chosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. Default value: `jdk`.
|
||||
|
||||
- `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.
|
||||
|
||||
- `jdk-file`: If a use-case requires a custom distribution setup-java uses the compressed JDK from the location pointed by this input and will take care of the installation and caching on the VM. Note: `distribution` must be set to 'jdkfile' (case-sensitive; all lowercase) when using this option. (The camelCase `jdkFile` input is still accepted as a deprecated alias and may be removed in a future release.)
|
||||
- `jdkFile`: If a use-case requires a custom distribution setup-java uses the compressed JDK from the location pointed by this input and will take care of the installation and caching on the VM. Note: `distribution` must be set to 'jdkfile' (case-sensitive; all lowercase) when using this option.
|
||||
|
||||
- `check-latest`: Setting this option makes the action to check for the latest available version for the version spec.
|
||||
|
||||
@ -130,7 +126,7 @@ Currently, the following distributions are supported:
|
||||
> [!NOTE]
|
||||
> - The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.
|
||||
> - AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` and `adopt-openj9`, to `temurin` and `semeru` respectively, to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
|
||||
> - For Azul Zulu OpenJDK, architecture `arm64` is mapped to `aarch64` when querying the Azul Metadata API.
|
||||
> - For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
|
||||
> - To comply with the GraalVM Free Terms and Conditions (GFTC) license, it is recommended to use GraalVM JDK 17 version 17.0.12, as this is the only version of GraalVM JDK 17 available under the GFTC license. Additionally, it is encouraged to consider upgrading to GraalVM JDK 21, which offers the latest features and improvements.
|
||||
> - GraalVM Community is available as `distribution: 'graalvm-community'` for stable JDK 17 and later releases published on GitHub.
|
||||
|
||||
@ -142,7 +138,7 @@ Currently, the following distributions are supported:
|
||||
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle, maven and sbt. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
|
||||
|
||||
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, and `**/versions.properties`
|
||||
- maven: `**/pom.xml`, `**/.mvn/wrapper/maven-wrapper.properties`, and `**/.mvn/extensions.xml`
|
||||
- maven: `**/pom.xml` and `**/.mvn/wrapper/maven-wrapper.properties`
|
||||
- sbt: all sbt build definition files `**/*.sbt`, `**/project/build.properties`, `**/project/**.scala`, `**/project/**.sbt`
|
||||
|
||||
When the option `cache-dependency-path` is specified, the hash is based on the matching file. This option supports wildcards and a list of file names, and is especially useful for monorepos.
|
||||
|
||||
@ -1,63 +1,24 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import {fileURLToPath} from 'url';
|
||||
import * as io from '@actions/io';
|
||||
import * as core from '@actions/core';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import os from 'os';
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
import * as auth from '../src/auth';
|
||||
import {M2_DIR, MVN_SETTINGS_FILE} from '../src/constants';
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const auth = await import('../src/auth.js');
|
||||
const {M2_DIR, MVN_SETTINGS_FILE} = await import('../src/constants.js');
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const m2Dir = path.join(__dirname, M2_DIR);
|
||||
const settingsFile = path.join(m2Dir, MVN_SETTINGS_FILE);
|
||||
|
||||
describe('auth tests', () => {
|
||||
let spyOSHomedir: any;
|
||||
let spyInfo: any;
|
||||
let spyOSHomedir: jest.SpyInstance;
|
||||
let spyInfo: jest.SpyInstance;
|
||||
|
||||
beforeEach(async () => {
|
||||
await io.rmRF(m2Dir);
|
||||
spyOSHomedir = jest.spyOn(os, 'homedir');
|
||||
spyOSHomedir.mockReturnValue(__dirname);
|
||||
spyInfo = core.info as jest.Mock;
|
||||
spyInfo = jest.spyOn(core, 'info');
|
||||
spyInfo.mockImplementation(() => null);
|
||||
}, 300000);
|
||||
|
||||
|
||||
@ -1,84 +1,23 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import {mkdtempSync} from 'fs';
|
||||
import {tmpdir} from 'os';
|
||||
import {join} from 'path';
|
||||
import {restore, save} from '../src/cache';
|
||||
import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('@actions/cache', () => ({
|
||||
restoreCache: jest.fn(),
|
||||
saveCache: jest.fn(),
|
||||
isFeatureAvailable: jest.fn(),
|
||||
ValidationError: class ValidationError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = 'ValidationError';
|
||||
}
|
||||
},
|
||||
ReserveCacheError: class ReserveCacheError extends Error {
|
||||
constructor(message: string) {
|
||||
super(message);
|
||||
this.name = 'ReserveCacheError';
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('@actions/glob', () => ({
|
||||
hashFiles: jest.fn(),
|
||||
create: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const cache = await import('@actions/cache');
|
||||
const glob = await import('@actions/glob');
|
||||
const {restore, save} = await import('../src/cache.js');
|
||||
import * as core from '@actions/core';
|
||||
import * as cache from '@actions/cache';
|
||||
import * as glob from '@actions/glob';
|
||||
|
||||
describe('dependency cache', () => {
|
||||
const ORIGINAL_RUNNER_OS = process.env['RUNNER_OS'];
|
||||
const ORIGINAL_GITHUB_WORKSPACE = process.env['GITHUB_WORKSPACE'];
|
||||
const ORIGINAL_CWD = process.cwd();
|
||||
let workspace: string;
|
||||
let spyInfo: any;
|
||||
let spyWarning: any;
|
||||
let spyDebug: any;
|
||||
let spySaveState: any;
|
||||
let spyCoreError: any;
|
||||
let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>;
|
||||
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>;
|
||||
let spyDebug: jest.SpyInstance<void, Parameters<typeof core.debug>>;
|
||||
let spySaveState: jest.SpyInstance<void, Parameters<typeof core.saveState>>;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
workspace = mkdtempSync(join(tmpdir(), 'setup-java-cache-'));
|
||||
@ -102,20 +41,20 @@ describe('dependency cache', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
spyInfo = core.info as jest.Mock;
|
||||
spyInfo = jest.spyOn(core, 'info');
|
||||
spyInfo.mockImplementation(() => null);
|
||||
|
||||
spyWarning = core.warning as jest.Mock;
|
||||
spyWarning = jest.spyOn(core, 'warning');
|
||||
spyWarning.mockImplementation(() => null);
|
||||
|
||||
spyDebug = core.debug as jest.Mock;
|
||||
spyDebug = jest.spyOn(core, 'debug');
|
||||
spyDebug.mockImplementation(() => null);
|
||||
|
||||
spySaveState = core.saveState as jest.Mock;
|
||||
spySaveState = jest.spyOn(core, 'saveState');
|
||||
spySaveState.mockImplementation(() => null);
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -131,15 +70,22 @@ describe('dependency cache', () => {
|
||||
});
|
||||
|
||||
describe('restore', () => {
|
||||
let spyCacheRestore: any;
|
||||
let spyGlobHashFiles: any;
|
||||
let spyCacheRestore: jest.SpyInstance<
|
||||
ReturnType<typeof cache.restoreCache>,
|
||||
Parameters<typeof cache.restoreCache>
|
||||
>;
|
||||
let spyGlobHashFiles: jest.SpyInstance<
|
||||
ReturnType<typeof glob.hashFiles>,
|
||||
Parameters<typeof glob.hashFiles>
|
||||
>;
|
||||
|
||||
beforeEach(() => {
|
||||
spyCacheRestore = (cache.restoreCache as any).mockImplementation(
|
||||
(paths: string[], primaryKey: string) => Promise.resolve(undefined)
|
||||
);
|
||||
spyGlobHashFiles = glob.hashFiles as jest.Mock;
|
||||
spyGlobHashFiles.mockResolvedValue('hash-stub');
|
||||
spyCacheRestore = jest
|
||||
.spyOn(cache, 'restoreCache')
|
||||
.mockImplementation((paths: string[], primaryKey: string) =>
|
||||
Promise.resolve(undefined)
|
||||
);
|
||||
spyGlobHashFiles = jest.spyOn(glob, 'hashFiles');
|
||||
spyWarning.mockImplementation(() => null);
|
||||
});
|
||||
|
||||
@ -150,12 +96,11 @@ describe('dependency cache', () => {
|
||||
});
|
||||
|
||||
describe('for maven', () => {
|
||||
it('throws error if no pom.xml, maven-wrapper.properties, or extensions.xml found', async () => {
|
||||
spyGlobHashFiles.mockResolvedValue('');
|
||||
it('throws error if no pom.xml or maven-wrapper.properties found', async () => {
|
||||
await expect(restore('maven', '')).rejects.toThrow(
|
||||
`No file in ${projectRoot(
|
||||
workspace
|
||||
)} matched to [**/pom.xml,**/.mvn/wrapper/maven-wrapper.properties,**/.mvn/extensions.xml], make sure you have checked out the target repository`
|
||||
)} matched to [**/pom.xml,**/.mvn/wrapper/maven-wrapper.properties], make sure you have checked out the target repository`
|
||||
);
|
||||
});
|
||||
it('downloads cache based on pom.xml', async () => {
|
||||
@ -170,7 +115,7 @@ describe('dependency cache', () => {
|
||||
expect.any(String)
|
||||
);
|
||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties\n**/.mvn/extensions.xml'
|
||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties'
|
||||
);
|
||||
expect(spyWarning).not.toHaveBeenCalled();
|
||||
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
|
||||
@ -191,25 +136,7 @@ describe('dependency cache', () => {
|
||||
expect.any(String)
|
||||
);
|
||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties\n**/.mvn/extensions.xml'
|
||||
);
|
||||
expect(spyWarning).not.toHaveBeenCalled();
|
||||
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
|
||||
});
|
||||
it('downloads cache based on extensions.xml', async () => {
|
||||
createDirectory(join(workspace, '.mvn'));
|
||||
createFile(join(workspace, '.mvn', 'extensions.xml'));
|
||||
|
||||
await restore('maven', '');
|
||||
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||
[
|
||||
join(os.homedir(), '.m2', 'repository'),
|
||||
join(os.homedir(), '.m2', 'wrapper', 'dists')
|
||||
],
|
||||
expect.any(String)
|
||||
);
|
||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties\n**/.mvn/extensions.xml'
|
||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties'
|
||||
);
|
||||
expect(spyWarning).not.toHaveBeenCalled();
|
||||
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
|
||||
@ -217,7 +144,6 @@ describe('dependency cache', () => {
|
||||
});
|
||||
describe('for gradle', () => {
|
||||
it('throws error if no build.gradle found', async () => {
|
||||
spyGlobHashFiles.mockResolvedValue('');
|
||||
await expect(restore('gradle', '')).rejects.toThrow(
|
||||
`No file in ${projectRoot(
|
||||
workspace
|
||||
@ -273,7 +199,6 @@ describe('dependency cache', () => {
|
||||
});
|
||||
describe('for sbt', () => {
|
||||
it('throws error if no build.sbt found', async () => {
|
||||
spyGlobHashFiles.mockResolvedValue('');
|
||||
await expect(restore('sbt', '')).rejects.toThrow(
|
||||
`No file in ${projectRoot(
|
||||
workspace
|
||||
@ -292,13 +217,6 @@ describe('dependency cache', () => {
|
||||
expect(spyInfo).toHaveBeenCalledWith('sbt cache is not found');
|
||||
});
|
||||
it('detects scala and sbt changes under **/project/ folder', async () => {
|
||||
let callCount = 0;
|
||||
spyGlobHashFiles.mockImplementation(async () => {
|
||||
callCount++;
|
||||
// Return same hash for first two calls, different for third
|
||||
return callCount <= 2 ? 'hash-v1' : 'hash-v2';
|
||||
});
|
||||
|
||||
createFile(join(workspace, 'build.sbt'));
|
||||
createDirectory(join(workspace, 'project'));
|
||||
createFile(join(workspace, 'project/DependenciesV1.scala'));
|
||||
@ -334,7 +252,6 @@ describe('dependency cache', () => {
|
||||
});
|
||||
describe('cache-dependency-path', () => {
|
||||
it('throws error if no matching dependency file found', async () => {
|
||||
spyGlobHashFiles.mockResolvedValue('');
|
||||
createFile(join(workspace, 'build.gradle.kts'));
|
||||
await expect(
|
||||
restore('gradle', 'sub-project/**/build.gradle.kts')
|
||||
@ -376,12 +293,17 @@ describe('dependency cache', () => {
|
||||
});
|
||||
});
|
||||
describe('save', () => {
|
||||
let spyCacheSave: any;
|
||||
let spyCacheSave: jest.SpyInstance<
|
||||
ReturnType<typeof cache.saveCache>,
|
||||
Parameters<typeof cache.saveCache>
|
||||
>;
|
||||
|
||||
beforeEach(() => {
|
||||
spyCacheSave = (cache.saveCache as any).mockImplementation(
|
||||
(paths: string[], key: string) => Promise.resolve(0)
|
||||
);
|
||||
spyCacheSave = jest
|
||||
.spyOn(cache, 'saveCache')
|
||||
.mockImplementation((paths: string[], key: string) =>
|
||||
Promise.resolve(0)
|
||||
);
|
||||
spyWarning.mockImplementation(() => null);
|
||||
});
|
||||
|
||||
@ -541,14 +463,14 @@ describe('dependency cache', () => {
|
||||
});
|
||||
|
||||
function resetState() {
|
||||
(core.getState as jest.Mock).mockReset();
|
||||
jest.spyOn(core, 'getState').mockReset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create states to emulate a restore process without build file.
|
||||
*/
|
||||
function createStateForMissingBuildFile() {
|
||||
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||
jest.spyOn(core, 'getState').mockImplementation(name => {
|
||||
switch (name) {
|
||||
case 'cache-primary-key':
|
||||
return 'setup-java-cache-';
|
||||
@ -562,7 +484,7 @@ function createStateForMissingBuildFile() {
|
||||
* Create states to emulate a successful restore process.
|
||||
*/
|
||||
function createStateForSuccessfulRestore() {
|
||||
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||
jest.spyOn(core, 'getState').mockImplementation(name => {
|
||||
switch (name) {
|
||||
case 'cache-primary-key':
|
||||
return 'setup-java-cache-primary-key';
|
||||
|
||||
@ -1,87 +1,32 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
|
||||
// Mock @actions/cache before importing source modules
|
||||
const real_cache_module = await import('@actions/cache');
|
||||
jest.unstable_mockModule('@actions/cache', () => ({
|
||||
...real_cache_module,
|
||||
saveCache: jest.fn(),
|
||||
restoreCache: jest.fn()
|
||||
}));
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../src/util.js');
|
||||
jest.unstable_mockModule('../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
extractJdkFile: jest.fn(),
|
||||
getDownloadArchiveExtension: jest.fn(),
|
||||
getToolcachePath: jest.fn(),
|
||||
isJobStatusSuccess: jest.fn(),
|
||||
renameWinArchive: jest.fn(),
|
||||
isVersionSatisfies: real_util_module.isVersionSatisfies,
|
||||
getTempDir: real_util_module.getTempDir
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const cache = await import('@actions/cache');
|
||||
const {run: cleanup} = await import('../src/cleanup-java.js');
|
||||
const util = await import('../src/util.js');
|
||||
import {run as cleanup} from '../src/cleanup-java';
|
||||
import * as core from '@actions/core';
|
||||
import * as cache from '@actions/cache';
|
||||
import * as util from '../src/util';
|
||||
|
||||
describe('cleanup', () => {
|
||||
let spyWarning: any;
|
||||
let spyInfo: any;
|
||||
let spyCacheSave: any;
|
||||
let spyJobStatusSuccess: any;
|
||||
let spyCoreError: any;
|
||||
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>;
|
||||
let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>;
|
||||
let spyCacheSave: jest.SpyInstance<
|
||||
ReturnType<typeof cache.saveCache>,
|
||||
Parameters<typeof cache.saveCache>
|
||||
>;
|
||||
let spyJobStatusSuccess: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyWarning = core.warning as jest.Mock;
|
||||
spyWarning = jest.spyOn(core, 'warning');
|
||||
spyWarning.mockImplementation(() => null);
|
||||
|
||||
spyInfo = core.info as jest.Mock;
|
||||
spyInfo = jest.spyOn(core, 'info');
|
||||
spyInfo.mockImplementation(() => null);
|
||||
|
||||
spyCacheSave = cache.saveCache as jest.Mock;
|
||||
spyCacheSave = jest.spyOn(cache, 'saveCache');
|
||||
|
||||
spyJobStatusSuccess = util.isJobStatusSuccess as jest.Mock;
|
||||
spyJobStatusSuccess = jest.spyOn(util, 'isJobStatusSuccess');
|
||||
spyJobStatusSuccess.mockReturnValue(true);
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
|
||||
createStateForSuccessfulRestore();
|
||||
@ -102,7 +47,7 @@ describe('cleanup', () => {
|
||||
)
|
||||
)
|
||||
);
|
||||
(core.getInput as jest.Mock<any>).mockImplementation((name: string) => {
|
||||
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
|
||||
return name === 'cache' ? 'gradle' : '';
|
||||
});
|
||||
await cleanup();
|
||||
@ -114,7 +59,7 @@ describe('cleanup', () => {
|
||||
spyCacheSave.mockImplementation((paths: string[], key: string) =>
|
||||
Promise.reject(new Error('Unexpected error'))
|
||||
);
|
||||
(core.getInput as jest.Mock<any>).mockImplementation((name: string) => {
|
||||
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
|
||||
return name === 'cache' ? 'gradle' : '';
|
||||
});
|
||||
await cleanup();
|
||||
@ -123,14 +68,14 @@ describe('cleanup', () => {
|
||||
});
|
||||
|
||||
function resetState() {
|
||||
(core.getState as jest.Mock).mockReset();
|
||||
jest.spyOn(core, 'getState').mockReset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create states to emulate a successful restore process.
|
||||
*/
|
||||
function createStateForSuccessfulRestore() {
|
||||
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||
jest.spyOn(core, 'getState').mockImplementation(name => {
|
||||
switch (name) {
|
||||
case 'cache-primary-key':
|
||||
return 'setup-java-cache-primary-key';
|
||||
|
||||
@ -1,686 +1,254 @@
|
||||
[
|
||||
{
|
||||
"package_uuid": "test-uuid-10996",
|
||||
"id": 10996,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-linux.tar.gz",
|
||||
"name": "zulu1.8.0_05-8.1.0.10-linux.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-linux.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
8,
|
||||
1,
|
||||
0,
|
||||
10
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 1, 0, 10],
|
||||
"jdk_version": [8, 0, 5, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10997",
|
||||
"id": 10997,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-linux.tar.gz",
|
||||
"name": "zulu1.8.0_11-8.2.0.1-linux.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-linux.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
11
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
8,
|
||||
2,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 2, 0, 1],
|
||||
"jdk_version": [8, 0, 11, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10346",
|
||||
"id": 10346,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux_x64.tar.gz",
|
||||
"name": "zulu8.21.0.1-jdk8.0.131-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
131
|
||||
],
|
||||
"openjdk_build_number": 11,
|
||||
"distro_version": [
|
||||
8,
|
||||
21,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 21, 0, 1],
|
||||
"jdk_version": [8, 0, 131, 11]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10362",
|
||||
"id": 10362,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
|
||||
"name": "zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
144
|
||||
],
|
||||
"openjdk_build_number": 1,
|
||||
"distro_version": [
|
||||
8,
|
||||
23,
|
||||
0,
|
||||
3
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 23, 0, 3],
|
||||
"jdk_version": [8, 0, 144, 1]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10399",
|
||||
"id": 10399,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-linux_x64.tar.gz",
|
||||
"name": "zulu8.25.0.1-jdk8.0.152-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
152
|
||||
],
|
||||
"openjdk_build_number": 16,
|
||||
"distro_version": [
|
||||
8,
|
||||
25,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 25, 0, 1],
|
||||
"jdk_version": [8, 0, 152, 16]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11355",
|
||||
"id": 11355,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-linux_x64.tar.gz",
|
||||
"name": "zulu8.46.0.19-ca-jdk8.0.252-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
252
|
||||
],
|
||||
"openjdk_build_number": 14,
|
||||
"distro_version": [
|
||||
8,
|
||||
46,
|
||||
0,
|
||||
19
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 46, 0, 19],
|
||||
"jdk_version": [8, 0, 252, 14]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11481",
|
||||
"id": 11481,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"name": "zulu8.48.0.47-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 17,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
47
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 47],
|
||||
"jdk_version": [8, 0, 262, 17]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11622",
|
||||
"id": 11622,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"name": "zulu8.48.0.51-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 19,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
51
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 51],
|
||||
"jdk_version": [8, 0, 262, 19]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11535",
|
||||
"id": 11535,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"name": "zulu8.48.0.49-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 18,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
49
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 49],
|
||||
"jdk_version": [8, 0, 262, 18]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12424",
|
||||
"id": 12424,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz",
|
||||
"name": "zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
282
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
8,
|
||||
52,
|
||||
0,
|
||||
23
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 52, 0, 23],
|
||||
"jdk_version": [8, 0, 282, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10383",
|
||||
"id": 10383,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-linux_x64.tar.gz",
|
||||
"name": "zulu9.0.0.15-jdk9.0.0-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
9,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 0,
|
||||
"distro_version": [
|
||||
9,
|
||||
0,
|
||||
0,
|
||||
15
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [9, 0, 0, 15],
|
||||
"jdk_version": [9, 0, 0, 0]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10413",
|
||||
"id": 10413,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-linux_x64.tar.gz",
|
||||
"name": "zulu9.0.1.3-jdk9.0.1-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
9,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 0,
|
||||
"distro_version": [
|
||||
9,
|
||||
0,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [9, 0, 1, 3],
|
||||
"jdk_version": [9, 0, 1, 0]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10503",
|
||||
"id": 10503,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-linux_x64.tar.gz",
|
||||
"name": "zulu10.2+3-jdk10.0.1-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
10,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
10,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [10, 2, 3, 0],
|
||||
"jdk_version": [10, 0, 1, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10541",
|
||||
"id": 10541,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-linux_x64.tar.gz",
|
||||
"name": "zulu10.3+5-jdk10.0.2-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
10,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
10,
|
||||
3,
|
||||
5,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [10, 3, 5, 0],
|
||||
"jdk_version": [10, 0, 2, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10576",
|
||||
"id": 10576,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-linux_x64.tar.gz",
|
||||
"name": "zulu11.2.3-jdk11.0.1-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
11,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 2, 3, 0],
|
||||
"jdk_version": [11, 0, 1, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10604",
|
||||
"id": 10604,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-linux_x64.tar.gz",
|
||||
"name": "zulu11.29.3-ca-jdk11.0.2-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
11,
|
||||
29,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 29, 3, 0],
|
||||
"jdk_version": [11, 0, 2, 7]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10687",
|
||||
"id": 10687,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz",
|
||||
"name": "zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
3
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
11,
|
||||
31,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 31, 11, 0],
|
||||
"jdk_version": [11, 0, 3, 7]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10856",
|
||||
"id": 10856,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"name": "zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
13,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 13, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10933",
|
||||
"id": 10933,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"name": "zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 15, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10933",
|
||||
"id": 10933,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"name": "zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 11, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12397",
|
||||
"id": 12397,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz",
|
||||
"name": "zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
10
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
11,
|
||||
45,
|
||||
27,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 45, 27, 0],
|
||||
"jdk_version": [11, 0, 10, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10667",
|
||||
"id": 10667,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-linux_x64.tar.gz",
|
||||
"name": "zulu12.1.3-ca-jdk12.0.0-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 33,
|
||||
"distro_version": [
|
||||
12,
|
||||
1,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 1, 3, 0],
|
||||
"jdk_version": [12, 0, 0, 33]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10710",
|
||||
"id": 10710,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz",
|
||||
"name": "zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
12,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 2, 3, 0],
|
||||
"jdk_version": [12, 0, 1, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10780",
|
||||
"id": 10780,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-linux_x64.tar.gz",
|
||||
"name": "zulu12.3.11-ca-jdk12.0.2-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 3,
|
||||
"distro_version": [
|
||||
12,
|
||||
3,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 3, 11, 0],
|
||||
"jdk_version": [12, 0, 2, 3]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10846",
|
||||
"id": 10846,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-linux_x64.tar.gz",
|
||||
"name": "zulu13.27.9-ca-jdk13.0.0-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 33,
|
||||
"distro_version": [
|
||||
13,
|
||||
27,
|
||||
9,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 27, 9, 0],
|
||||
"jdk_version": [13, 0, 0, 33]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10888",
|
||||
"id": 10888,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz",
|
||||
"name": "zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
13,
|
||||
28,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 28, 11, 0],
|
||||
"jdk_version": [13, 0, 1, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11073",
|
||||
"id": 11073,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-linux_x64.tar.gz",
|
||||
"name": "zulu13.29.9-ca-jdk13.0.2-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 6,
|
||||
"distro_version": [
|
||||
13,
|
||||
29,
|
||||
9,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 29, 9, 0],
|
||||
"jdk_version": [13, 0, 2, 6]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12408",
|
||||
"id": 12408,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-linux_x64.tar.gz",
|
||||
"name": "zulu13.37.21-ca-jdk13.0.6-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
6
|
||||
],
|
||||
"openjdk_build_number": 5,
|
||||
"distro_version": [
|
||||
13,
|
||||
37,
|
||||
21,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 37, 21, 0],
|
||||
"jdk_version": [13, 0, 6, 5]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11236",
|
||||
"id": 11236,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-linux_x64.tar.gz",
|
||||
"name": "zulu14.27.1-ca-jdk14.0.0-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 36,
|
||||
"distro_version": [
|
||||
14,
|
||||
27,
|
||||
1,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 27, 1, 0],
|
||||
"jdk_version": [14, 0, 0, 36]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11349",
|
||||
"id": 11349,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-linux_x64.tar.gz",
|
||||
"name": "zulu14.28.21-ca-jdk14.0.1-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
14,
|
||||
28,
|
||||
21,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 28, 21, 0],
|
||||
"jdk_version": [14, 0, 1, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11513",
|
||||
"id": 11513,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-linux_x64.tar.gz",
|
||||
"name": "zulu14.29.23-ca-jdk14.0.2-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
14,
|
||||
29,
|
||||
23,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 29, 23, 0],
|
||||
"jdk_version": [14, 0, 2, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11780",
|
||||
"id": 11780,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz",
|
||||
"name": "zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 36,
|
||||
"distro_version": [
|
||||
15,
|
||||
27,
|
||||
17,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 27, 17, 0],
|
||||
"jdk_version": [15, 0, 0, 36]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11924",
|
||||
"id": 11924,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||
"name": "zulu15.28.13-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
15,
|
||||
28,
|
||||
13,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 28, 13, 0],
|
||||
"jdk_version": [15, 0, 1, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12101",
|
||||
"id": 12101,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||
"name": "zulu15.28.51-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
15,
|
||||
28,
|
||||
51,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 28, 51, 0],
|
||||
"jdk_version": [15, 0, 1, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12445",
|
||||
"id": 12445,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-linux_x64.tar.gz",
|
||||
"name": "zulu15.29.15-ca-jdk15.0.2-linux_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-linux_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
15,
|
||||
29,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 29, 15, 0],
|
||||
"jdk_version": [15, 0, 2, 7]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12447",
|
||||
"id": 12447,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
|
||||
"name": "zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
|
||||
"java_version": [
|
||||
21,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 6,
|
||||
"distro_version": [
|
||||
21,
|
||||
32,
|
||||
17,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [21, 32, 17, 0],
|
||||
"jdk_version": [21, 0, 2, 6]
|
||||
}
|
||||
]
|
||||
@ -1,667 +1,247 @@
|
||||
[
|
||||
{
|
||||
"package_uuid": "test-uuid-10996",
|
||||
"id": 10996,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-macosx.tar.gz",
|
||||
"name": "zulu1.8.0_05-8.1.0.10-macosx.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-macosx.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
8,
|
||||
1,
|
||||
0,
|
||||
10
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 1, 0, 10],
|
||||
"jdk_version": [8, 0, 5, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10997",
|
||||
"id": 10997,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-macosx.tar.gz",
|
||||
"name": "zulu1.8.0_11-8.2.0.1-macosx.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-macosx.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
11
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
8,
|
||||
2,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 2, 0, 1],
|
||||
"jdk_version": [8, 0, 11, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10346",
|
||||
"id": 10346,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-macosx_x64.tar.gz",
|
||||
"name": "zulu8.21.0.1-jdk8.0.131-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
131
|
||||
],
|
||||
"openjdk_build_number": 11,
|
||||
"distro_version": [
|
||||
8,
|
||||
21,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 21, 0, 1],
|
||||
"jdk_version": [8, 0, 131, 11]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10362",
|
||||
"id": 10362,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-macosx_x64.tar.gz",
|
||||
"name": "zulu8.23.0.3-jdk8.0.144-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
144
|
||||
],
|
||||
"openjdk_build_number": 1,
|
||||
"distro_version": [
|
||||
8,
|
||||
23,
|
||||
0,
|
||||
3
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 23, 0, 3],
|
||||
"jdk_version": [8, 0, 144, 1]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10399",
|
||||
"id": 10399,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-macosx_x64.tar.gz",
|
||||
"name": "zulu8.25.0.1-jdk8.0.152-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
152
|
||||
],
|
||||
"openjdk_build_number": 16,
|
||||
"distro_version": [
|
||||
8,
|
||||
25,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 25, 0, 1],
|
||||
"jdk_version": [8, 0, 152, 16]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11355",
|
||||
"id": 11355,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-macosx_x64.tar.gz",
|
||||
"name": "zulu8.46.0.19-ca-jdk8.0.252-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
252
|
||||
],
|
||||
"openjdk_build_number": 14,
|
||||
"distro_version": [
|
||||
8,
|
||||
46,
|
||||
0,
|
||||
19
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 46, 0, 19],
|
||||
"jdk_version": [8, 0, 252, 14]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11481",
|
||||
"id": 11481,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"name": "zulu8.48.0.47-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 17,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
47
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 47],
|
||||
"jdk_version": [8, 0, 262, 17]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11622",
|
||||
"id": 11622,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"name": "zulu8.48.0.51-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 19,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
51
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 51],
|
||||
"jdk_version": [8, 0, 262, 19]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11535",
|
||||
"id": 11535,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"name": "zulu8.48.0.49-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 18,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
49
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 49],
|
||||
"jdk_version": [8, 0, 262, 18]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12424",
|
||||
"id": 12424,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-macosx_x64.tar.gz",
|
||||
"name": "zulu8.52.0.23-ca-jdk8.0.282-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
282
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
8,
|
||||
52,
|
||||
0,
|
||||
23
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 52, 0, 23],
|
||||
"jdk_version": [8, 0, 282, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10383",
|
||||
"id": 10383,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-macosx_x64.tar.gz",
|
||||
"name": "zulu9.0.0.15-jdk9.0.0-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
9,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 0,
|
||||
"distro_version": [
|
||||
9,
|
||||
0,
|
||||
0,
|
||||
15
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [9, 0, 0, 15],
|
||||
"jdk_version": [9, 0, 0, 0]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10413",
|
||||
"id": 10413,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-macosx_x64.tar.gz",
|
||||
"name": "zulu9.0.1.3-jdk9.0.1-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
9,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 0,
|
||||
"distro_version": [
|
||||
9,
|
||||
0,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [9, 0, 1, 3],
|
||||
"jdk_version": [9, 0, 1, 0]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10503",
|
||||
"id": 10503,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-macosx_x64.tar.gz",
|
||||
"name": "zulu10.2+3-jdk10.0.1-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
10,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
10,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [10, 2, 3, 0],
|
||||
"jdk_version": [10, 0, 1, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10541",
|
||||
"id": 10541,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-macosx_x64.tar.gz",
|
||||
"name": "zulu10.3+5-jdk10.0.2-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
10,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
10,
|
||||
3,
|
||||
5,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [10, 3, 5, 0],
|
||||
"jdk_version": [10, 0, 2, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10576",
|
||||
"id": 10576,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz",
|
||||
"name": "zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
11,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 2, 3, 0],
|
||||
"jdk_version": [11, 0, 1, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10604",
|
||||
"id": 10604,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-macosx_x64.tar.gz",
|
||||
"name": "zulu11.29.3-ca-jdk11.0.2-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
11,
|
||||
29,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 29, 3, 0],
|
||||
"jdk_version": [11, 0, 2, 7]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10687",
|
||||
"id": 10687,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-macosx_x64.tar.gz",
|
||||
"name": "zulu11.31.11-ca-jdk11.0.3-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
3
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
11,
|
||||
31,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 31, 11, 0],
|
||||
"jdk_version": [11, 0, 3, 7]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10856",
|
||||
"id": 10856,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"name": "zulu11.35.13-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
13,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 13, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10933",
|
||||
"id": 10933,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"name": "zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 15, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10933",
|
||||
"id": 10933,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"name": "zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 11, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12397",
|
||||
"id": 12397,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-macosx_x64.tar.gz",
|
||||
"name": "zulu11.45.27-ca-jdk11.0.10-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
10
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
11,
|
||||
45,
|
||||
27,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 45, 27, 0],
|
||||
"jdk_version": [11, 0, 10, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10667",
|
||||
"id": 10667,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-macosx_x64.tar.gz",
|
||||
"name": "zulu12.1.3-ca-jdk12.0.0-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 33,
|
||||
"distro_version": [
|
||||
12,
|
||||
1,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 1, 3, 0],
|
||||
"jdk_version": [12, 0, 0, 33]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10710",
|
||||
"id": 10710,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-macosx_x64.tar.gz",
|
||||
"name": "zulu12.2.3-ca-jdk12.0.1-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
12,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 2, 3, 0],
|
||||
"jdk_version": [12, 0, 1, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10780",
|
||||
"id": 10780,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-macosx_x64.tar.gz",
|
||||
"name": "zulu12.3.11-ca-jdk12.0.2-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 3,
|
||||
"distro_version": [
|
||||
12,
|
||||
3,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 3, 11, 0],
|
||||
"jdk_version": [12, 0, 2, 3]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10846",
|
||||
"id": 10846,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-macosx_x64.tar.gz",
|
||||
"name": "zulu13.27.9-ca-jdk13.0.0-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 33,
|
||||
"distro_version": [
|
||||
13,
|
||||
27,
|
||||
9,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 27, 9, 0],
|
||||
"jdk_version": [13, 0, 0, 33]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10888",
|
||||
"id": 10888,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-macosx_x64.tar.gz",
|
||||
"name": "zulu13.28.11-ca-jdk13.0.1-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
13,
|
||||
28,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 28, 11, 0],
|
||||
"jdk_version": [13, 0, 1, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11073",
|
||||
"id": 11073,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-macosx_x64.tar.gz",
|
||||
"name": "zulu13.29.9-ca-jdk13.0.2-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 6,
|
||||
"distro_version": [
|
||||
13,
|
||||
29,
|
||||
9,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 29, 9, 0],
|
||||
"jdk_version": [13, 0, 2, 6]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12408",
|
||||
"id": 12408,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-macosx_x64.tar.gz",
|
||||
"name": "zulu13.37.21-ca-jdk13.0.6-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
6
|
||||
],
|
||||
"openjdk_build_number": 5,
|
||||
"distro_version": [
|
||||
13,
|
||||
37,
|
||||
21,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 37, 21, 0],
|
||||
"jdk_version": [13, 0, 6, 5]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11236",
|
||||
"id": 11236,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-macosx_x64.tar.gz",
|
||||
"name": "zulu14.27.1-ca-jdk14.0.0-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 36,
|
||||
"distro_version": [
|
||||
14,
|
||||
27,
|
||||
1,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 27, 1, 0],
|
||||
"jdk_version": [14, 0, 0, 36]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11349",
|
||||
"id": 11349,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-macosx_x64.tar.gz",
|
||||
"name": "zulu14.28.21-ca-jdk14.0.1-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
14,
|
||||
28,
|
||||
21,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 28, 21, 0],
|
||||
"jdk_version": [14, 0, 1, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11513",
|
||||
"id": 11513,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-macosx_x64.tar.gz",
|
||||
"name": "zulu14.29.23-ca-jdk14.0.2-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
14,
|
||||
29,
|
||||
23,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 29, 23, 0],
|
||||
"jdk_version": [14, 0, 2, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11780",
|
||||
"id": 11780,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-macosx_x64.tar.gz",
|
||||
"name": "zulu15.27.17-ca-jdk15.0.0-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 36,
|
||||
"distro_version": [
|
||||
15,
|
||||
27,
|
||||
17,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 27, 17, 0],
|
||||
"jdk_version": [15, 0, 0, 36]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11924",
|
||||
"id": 11924,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||
"name": "zulu15.28.13-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
15,
|
||||
28,
|
||||
13,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 28, 13, 0],
|
||||
"jdk_version": [15, 0, 1, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12101",
|
||||
"id": 12101,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||
"name": "zulu15.28.51-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
15,
|
||||
28,
|
||||
51,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 28, 51, 0],
|
||||
"jdk_version": [15, 0, 1, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12445",
|
||||
"id": 12445,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-macosx_x64.tar.gz",
|
||||
"name": "zulu15.29.15-ca-jdk15.0.2-macosx_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-macosx_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
15,
|
||||
29,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 29, 15, 0],
|
||||
"jdk_version": [15, 0, 2, 7]
|
||||
}
|
||||
]
|
||||
|
||||
@ -1,686 +1,254 @@
|
||||
[
|
||||
{
|
||||
"package_uuid": "test-uuid-10996",
|
||||
"id": 10996,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-windows.tar.gz",
|
||||
"name": "zulu1.8.0_05-8.1.0.10-windows.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-windows.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
8,
|
||||
1,
|
||||
0,
|
||||
10
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 1, 0, 10],
|
||||
"jdk_version": [8, 0, 5, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10997",
|
||||
"id": 10997,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-windows.tar.gz",
|
||||
"name": "zulu1.8.0_11-8.2.0.1-windows.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-windows.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
11
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
8,
|
||||
2,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 2, 0, 1],
|
||||
"jdk_version": [8, 0, 11, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10346",
|
||||
"id": 10346,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-windows_x64.tar.gz",
|
||||
"name": "zulu8.21.0.1-jdk8.0.131-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
131
|
||||
],
|
||||
"openjdk_build_number": 11,
|
||||
"distro_version": [
|
||||
8,
|
||||
21,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 21, 0, 1],
|
||||
"jdk_version": [8, 0, 131, 11]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10362",
|
||||
"id": 10362,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-windows_x64.tar.gz",
|
||||
"name": "zulu8.23.0.3-jdk8.0.144-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
144
|
||||
],
|
||||
"openjdk_build_number": 1,
|
||||
"distro_version": [
|
||||
8,
|
||||
23,
|
||||
0,
|
||||
3
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 23, 0, 3],
|
||||
"jdk_version": [8, 0, 144, 1]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10399",
|
||||
"id": 10399,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-windows_x64.tar.gz",
|
||||
"name": "zulu8.25.0.1-jdk8.0.152-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
152
|
||||
],
|
||||
"openjdk_build_number": 16,
|
||||
"distro_version": [
|
||||
8,
|
||||
25,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 25, 0, 1],
|
||||
"jdk_version": [8, 0, 152, 16]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11355",
|
||||
"id": 11355,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-windows_x64.tar.gz",
|
||||
"name": "zulu8.46.0.19-ca-jdk8.0.252-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
252
|
||||
],
|
||||
"openjdk_build_number": 14,
|
||||
"distro_version": [
|
||||
8,
|
||||
46,
|
||||
0,
|
||||
19
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 46, 0, 19],
|
||||
"jdk_version": [8, 0, 252, 14]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11481",
|
||||
"id": 11481,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"name": "zulu8.48.0.47-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 17,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
47
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 47],
|
||||
"jdk_version": [8, 0, 262, 17]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11622",
|
||||
"id": 11622,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"name": "zulu8.48.0.51-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 19,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
51
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 51],
|
||||
"jdk_version": [8, 0, 262, 19]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11535",
|
||||
"id": 11535,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"name": "zulu8.48.0.49-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
262
|
||||
],
|
||||
"openjdk_build_number": 18,
|
||||
"distro_version": [
|
||||
8,
|
||||
48,
|
||||
0,
|
||||
49
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 48, 0, 49],
|
||||
"jdk_version": [8, 0, 262, 18]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12424",
|
||||
"id": 12424,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-windows_x64.tar.gz",
|
||||
"name": "zulu8.52.0.23-ca-jdk8.0.282-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
8,
|
||||
0,
|
||||
282
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
8,
|
||||
52,
|
||||
0,
|
||||
23
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [8, 52, 0, 23],
|
||||
"jdk_version": [8, 0, 282, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10383",
|
||||
"id": 10383,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-windows_x64.tar.gz",
|
||||
"name": "zulu9.0.0.15-jdk9.0.0-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
9,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 0,
|
||||
"distro_version": [
|
||||
9,
|
||||
0,
|
||||
0,
|
||||
15
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [9, 0, 0, 15],
|
||||
"jdk_version": [9, 0, 0, 0]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10413",
|
||||
"id": 10413,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-windows_x64.tar.gz",
|
||||
"name": "zulu9.0.1.3-jdk9.0.1-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
9,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 0,
|
||||
"distro_version": [
|
||||
9,
|
||||
0,
|
||||
1,
|
||||
3
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [9, 0, 1, 3],
|
||||
"jdk_version": [9, 0, 1, 0]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10503",
|
||||
"id": 10503,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-windows_x64.tar.gz",
|
||||
"name": "zulu10.2+3-jdk10.0.1-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
10,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
10,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [10, 2, 3, 0],
|
||||
"jdk_version": [10, 0, 1, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10541",
|
||||
"id": 10541,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-windows_x64.tar.gz",
|
||||
"name": "zulu10.3+5-jdk10.0.2-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
10,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
10,
|
||||
3,
|
||||
5,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [10, 3, 5, 0],
|
||||
"jdk_version": [10, 0, 2, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10576",
|
||||
"id": 10576,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-windows_x64.tar.gz",
|
||||
"name": "zulu11.2.3-jdk11.0.1-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 13,
|
||||
"distro_version": [
|
||||
11,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 2, 3, 0],
|
||||
"jdk_version": [11, 0, 1, 13]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10604",
|
||||
"id": 10604,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-windows_x64.tar.gz",
|
||||
"name": "zulu11.29.3-ca-jdk11.0.2-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
11,
|
||||
29,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 29, 3, 0],
|
||||
"jdk_version": [11, 0, 2, 7]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10687",
|
||||
"id": 10687,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-windows_x64.tar.gz",
|
||||
"name": "zulu11.31.11-ca-jdk11.0.3-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
3
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
11,
|
||||
31,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 31, 11, 0],
|
||||
"jdk_version": [11, 0, 3, 7]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10856",
|
||||
"id": 10856,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"name": "zulu11.35.13-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
13,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 13, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10933",
|
||||
"id": 10933,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"name": "zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 15, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10933",
|
||||
"id": 10933,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"name": "zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
5
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
11,
|
||||
35,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 35, 11, 0],
|
||||
"jdk_version": [11, 0, 5, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12397",
|
||||
"id": 12397,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-windows_x64.tar.gz",
|
||||
"name": "zulu11.45.27-ca-jdk11.0.10-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
11,
|
||||
0,
|
||||
10
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
11,
|
||||
45,
|
||||
27,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [11, 45, 27, 0],
|
||||
"jdk_version": [11, 0, 10, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10667",
|
||||
"id": 10667,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-windows_x64.tar.gz",
|
||||
"name": "zulu12.1.3-ca-jdk12.0.0-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 33,
|
||||
"distro_version": [
|
||||
12,
|
||||
1,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 1, 3, 0],
|
||||
"jdk_version": [12, 0, 0, 33]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10710",
|
||||
"id": 10710,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-windows_x64.tar.gz",
|
||||
"name": "zulu12.2.3-ca-jdk12.0.1-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
12,
|
||||
2,
|
||||
3,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 2, 3, 0],
|
||||
"jdk_version": [12, 0, 1, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10780",
|
||||
"id": 10780,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-windows_x64.tar.gz",
|
||||
"name": "zulu12.3.11-ca-jdk12.0.2-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
12,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 3,
|
||||
"distro_version": [
|
||||
12,
|
||||
3,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [12, 3, 11, 0],
|
||||
"jdk_version": [12, 0, 2, 3]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10846",
|
||||
"id": 10846,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-windows_x64.tar.gz",
|
||||
"name": "zulu13.27.9-ca-jdk13.0.0-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 33,
|
||||
"distro_version": [
|
||||
13,
|
||||
27,
|
||||
9,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 27, 9, 0],
|
||||
"jdk_version": [13, 0, 0, 33]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-10888",
|
||||
"id": 10888,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-windows_x64.tar.gz",
|
||||
"name": "zulu13.28.11-ca-jdk13.0.1-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 10,
|
||||
"distro_version": [
|
||||
13,
|
||||
28,
|
||||
11,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 28, 11, 0],
|
||||
"jdk_version": [13, 0, 1, 10]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11073",
|
||||
"id": 11073,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-windows_x64.tar.gz",
|
||||
"name": "zulu13.29.9-ca-jdk13.0.2-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 6,
|
||||
"distro_version": [
|
||||
13,
|
||||
29,
|
||||
9,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 29, 9, 0],
|
||||
"jdk_version": [13, 0, 2, 6]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12408",
|
||||
"id": 12408,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-windows_x64.tar.gz",
|
||||
"name": "zulu13.37.21-ca-jdk13.0.6-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
13,
|
||||
0,
|
||||
6
|
||||
],
|
||||
"openjdk_build_number": 5,
|
||||
"distro_version": [
|
||||
13,
|
||||
37,
|
||||
21,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [13, 37, 21, 0],
|
||||
"jdk_version": [13, 0, 6, 5]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11236",
|
||||
"id": 11236,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-windows_x64.tar.gz",
|
||||
"name": "zulu14.27.1-ca-jdk14.0.0-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 36,
|
||||
"distro_version": [
|
||||
14,
|
||||
27,
|
||||
1,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 27, 1, 0],
|
||||
"jdk_version": [14, 0, 0, 36]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11349",
|
||||
"id": 11349,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-windows_x64.tar.gz",
|
||||
"name": "zulu14.28.21-ca-jdk14.0.1-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
14,
|
||||
28,
|
||||
21,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 28, 21, 0],
|
||||
"jdk_version": [14, 0, 1, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11513",
|
||||
"id": 11513,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-windows_x64.tar.gz",
|
||||
"name": "zulu14.29.23-ca-jdk14.0.2-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
14,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 12,
|
||||
"distro_version": [
|
||||
14,
|
||||
29,
|
||||
23,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [14, 29, 23, 0],
|
||||
"jdk_version": [14, 0, 2, 12]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11780",
|
||||
"id": 11780,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-windows_x64.tar.gz",
|
||||
"name": "zulu15.27.17-ca-jdk15.0.0-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"openjdk_build_number": 36,
|
||||
"distro_version": [
|
||||
15,
|
||||
27,
|
||||
17,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 27, 17, 0],
|
||||
"jdk_version": [15, 0, 0, 36]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-11924",
|
||||
"id": 11924,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||
"name": "zulu15.28.13-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 8,
|
||||
"distro_version": [
|
||||
15,
|
||||
28,
|
||||
13,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 28, 13, 0],
|
||||
"jdk_version": [15, 0, 1, 8]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12101",
|
||||
"id": 12101,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||
"name": "zulu15.28.51-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
1
|
||||
],
|
||||
"openjdk_build_number": 9,
|
||||
"distro_version": [
|
||||
15,
|
||||
28,
|
||||
51,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 28, 51, 0],
|
||||
"jdk_version": [15, 0, 1, 9]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12445",
|
||||
"id": 12445,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-windows_x64.tar.gz",
|
||||
"name": "zulu15.29.15-ca-jdk15.0.2-windows_x64.tar.gz",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-windows_x64.tar.gz",
|
||||
"java_version": [
|
||||
15,
|
||||
0,
|
||||
2
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
15,
|
||||
29,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"zulu_version": [15, 29, 15, 0],
|
||||
"jdk_version": [15, 0, 2, 7]
|
||||
},
|
||||
{
|
||||
"package_uuid": "test-uuid-12446",
|
||||
"name": "zulu17.48.15-ca-jdk17.0.10-win_aarch64.zip",
|
||||
"download_url": "https://cdn.azul.com/zulu/bin/zulu17.48.15-ca-jdk17.0.10-windows_aarch64.zip",
|
||||
"java_version": [
|
||||
17,
|
||||
0,
|
||||
10
|
||||
],
|
||||
"openjdk_build_number": 7,
|
||||
"distro_version": [
|
||||
17,
|
||||
48,
|
||||
15,
|
||||
0
|
||||
],
|
||||
"latest": false,
|
||||
"availability_type": "ca"
|
||||
"id": 12446,
|
||||
"url": "https://cdn.azul.com/zulu/bin/zulu17.48.15-ca-jdk17.0.10-windows_aarch64.zip",
|
||||
"name": "zulu17.48.15-ca-jdk17.0.10-win_aarch4.zip",
|
||||
"zulu_version": [17, 48, 15, 0],
|
||||
"jdk_version": [17, 0, 10, 7]
|
||||
}
|
||||
]
|
||||
@ -1,59 +1,21 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import {IAdoptAvailableVersions} from '../../src/distributions/adopt/models';
|
||||
import {
|
||||
AdoptDistribution,
|
||||
AdoptImplementation
|
||||
} from '../../src/distributions/adopt/installer';
|
||||
import {TemurinDistribution} from '../../src/distributions/temurin/installer';
|
||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
||||
|
||||
import os from 'os';
|
||||
|
||||
import manifestData from '../data/adopt.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {AdoptDistribution, AdoptImplementation} =
|
||||
await import('../../src/distributions/adopt/installer.js');
|
||||
const {TemurinDistribution} =
|
||||
await import('../../src/distributions/temurin/installer.js');
|
||||
|
||||
import type {IAdoptAvailableVersions} from '../../src/distributions/adopt/models.js';
|
||||
import type {AdoptImplementation as AdoptImplementationType} from '../../src/distributions/adopt/installer.js';
|
||||
import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
|
||||
import manifestData from '../data/adopt.json';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyCoreWarning: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
let spyCoreWarning: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -64,9 +26,9 @@ describe('getAvailableVersions', () => {
|
||||
});
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
spyCoreWarning = core.warning as jest.Mock;
|
||||
spyCoreWarning = jest.spyOn(core, 'warning');
|
||||
spyCoreWarning.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -161,7 +123,7 @@ describe('getAvailableVersions', () => {
|
||||
'build correct url for %s',
|
||||
async (
|
||||
installerOptions: JavaInstallerOptions,
|
||||
impl: AdoptImplementationType,
|
||||
impl: AdoptImplementation,
|
||||
expectedParameters
|
||||
) => {
|
||||
const distribution = new AdoptDistribution(installerOptions, impl);
|
||||
@ -242,7 +204,7 @@ describe('getAvailableVersions', () => {
|
||||
[AdoptImplementation.OpenJ9, 'jre', 'Java_Adopt-OpenJ9_jre']
|
||||
])(
|
||||
'find right toolchain folder',
|
||||
(impl: AdoptImplementationType, packageType: string, expected: string) => {
|
||||
(impl: AdoptImplementation, packageType: string, expected: string) => {
|
||||
const distribution = new AdoptDistribution(
|
||||
{
|
||||
version: '11',
|
||||
@ -301,11 +263,11 @@ describe('findPackageForDownload', () => {
|
||||
url: 'https://example.test/temurin-11.tar.gz'
|
||||
};
|
||||
const temurinFindPackageForDownload = jest
|
||||
.fn<any>()
|
||||
.fn()
|
||||
.mockResolvedValue(temurinRelease);
|
||||
const temurinDistribution = {
|
||||
findPackageForDownload: temurinFindPackageForDownload
|
||||
} as any;
|
||||
} as unknown as TemurinDistribution;
|
||||
|
||||
const distribution = new AdoptDistribution(
|
||||
{
|
||||
@ -317,7 +279,7 @@ describe('findPackageForDownload', () => {
|
||||
AdoptImplementation.Hotspot,
|
||||
temurinDistribution
|
||||
);
|
||||
const adoptLookupSpy = jest.fn<any>();
|
||||
const adoptLookupSpy = jest.fn();
|
||||
distribution['getAvailableVersions'] = adoptLookupSpy;
|
||||
|
||||
const resolvedVersion = await distribution['findPackageForDownload']('11');
|
||||
|
||||
@ -1,90 +1,19 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../../src/distributions/base-models.js';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as core from '@actions/core';
|
||||
import * as util from '../../src/util';
|
||||
|
||||
import path from 'path';
|
||||
import * as semver from 'semver';
|
||||
|
||||
import {JavaBase} from '../../src/distributions/base-installer';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../../src/distributions/base-models';
|
||||
|
||||
import os from 'os';
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('@actions/tool-cache', () => ({
|
||||
find: jest.fn(),
|
||||
findAllVersions: jest.fn(),
|
||||
downloadTool: jest.fn(),
|
||||
extractZip: jest.fn(),
|
||||
extractTar: jest.fn(),
|
||||
extract7z: jest.fn(),
|
||||
extractXar: jest.fn(),
|
||||
cacheDir: jest.fn(),
|
||||
cacheFile: jest.fn(),
|
||||
getManifestFromRepo: jest.fn(),
|
||||
findFromManifest: jest.fn(),
|
||||
evaluateVersions: jest.fn(),
|
||||
HTTPError: class HTTPError extends Error {
|
||||
httpStatusCode: number;
|
||||
constructor(statusCode: number) {
|
||||
super(`HTTP Error: ${statusCode}`);
|
||||
this.httpStatusCode = statusCode;
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
extractJdkFile: jest.fn(),
|
||||
getDownloadArchiveExtension: jest.fn(),
|
||||
getToolcachePath: jest.fn(),
|
||||
isJobStatusSuccess: jest.fn(),
|
||||
renameWinArchive: jest.fn(),
|
||||
isVersionSatisfies: real_util_module.isVersionSatisfies,
|
||||
getTempDir: real_util_module.getTempDir
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const tc = await import('@actions/tool-cache');
|
||||
const util = await import('../../src/util.js');
|
||||
const {JavaBase} = await import('../../src/distributions/base-installer.js');
|
||||
|
||||
class EmptyJavaBase extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
super('Empty', installerOptions);
|
||||
@ -124,12 +53,12 @@ describe('findInToolcache', () => {
|
||||
const javaPath = path.join('Java_Empty_jdk', actualJavaVersion, 'x64');
|
||||
|
||||
let mockJavaBase: EmptyJavaBase;
|
||||
let spyGetToolcachePath: any;
|
||||
let spyTcFindAllVersions: any;
|
||||
let spyGetToolcachePath: jest.SpyInstance;
|
||||
let spyTcFindAllVersions: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyGetToolcachePath = util.getToolcachePath as jest.Mock;
|
||||
spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
|
||||
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
||||
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@ -312,17 +241,17 @@ describe('setupJava', () => {
|
||||
|
||||
let mockJavaBase: EmptyJavaBase;
|
||||
|
||||
let spyGetToolcachePath: any;
|
||||
let spyTcFindAllVersions: any;
|
||||
let spyCoreDebug: any;
|
||||
let spyCoreInfo: any;
|
||||
let spyCoreExportVariable: any;
|
||||
let spyCoreAddPath: any;
|
||||
let spyCoreSetOutput: any;
|
||||
let spyCoreError: any;
|
||||
let spyGetToolcachePath: jest.SpyInstance;
|
||||
let spyTcFindAllVersions: jest.SpyInstance;
|
||||
let spyCoreDebug: jest.SpyInstance;
|
||||
let spyCoreInfo: jest.SpyInstance;
|
||||
let spyCoreExportVariable: jest.SpyInstance;
|
||||
let spyCoreAddPath: jest.SpyInstance;
|
||||
let spyCoreSetOutput: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyGetToolcachePath = util.getToolcachePath as jest.Mock;
|
||||
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
||||
spyGetToolcachePath.mockImplementation(
|
||||
(toolname: string, javaVersion: string, architecture: string) => {
|
||||
const semverVersion = new semver.Range(javaVersion);
|
||||
@ -340,27 +269,27 @@ describe('setupJava', () => {
|
||||
}
|
||||
);
|
||||
|
||||
spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
|
||||
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
||||
spyTcFindAllVersions.mockReturnValue([installedJavaVersion]);
|
||||
|
||||
// Spy on core methods
|
||||
spyCoreDebug = core.debug as jest.Mock;
|
||||
spyCoreDebug = jest.spyOn(core, 'debug');
|
||||
spyCoreDebug.mockImplementation(() => undefined);
|
||||
|
||||
spyCoreInfo = core.info as jest.Mock;
|
||||
spyCoreInfo = jest.spyOn(core, 'info');
|
||||
spyCoreInfo.mockImplementation(() => undefined);
|
||||
|
||||
spyCoreAddPath = core.addPath as jest.Mock;
|
||||
spyCoreAddPath = jest.spyOn(core, 'addPath');
|
||||
spyCoreAddPath.mockImplementation(() => undefined);
|
||||
|
||||
spyCoreExportVariable = core.exportVariable as jest.Mock;
|
||||
spyCoreExportVariable = jest.spyOn(core, 'exportVariable');
|
||||
spyCoreExportVariable.mockImplementation(() => undefined);
|
||||
|
||||
spyCoreSetOutput = core.setOutput as jest.Mock;
|
||||
spyCoreSetOutput = jest.spyOn(core, 'setOutput');
|
||||
spyCoreSetOutput.mockImplementation(() => undefined);
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => undefined);
|
||||
|
||||
jest.spyOn(os, 'arch').mockReturnValue('x86' as ReturnType<typeof os.arch>);
|
||||
|
||||
@ -1,62 +1,17 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
||||
|
||||
import {CorrettoDistribution} from '../../src/distributions/corretto/installer';
|
||||
import * as util from '../../src/util';
|
||||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/corretto.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
getDownloadArchiveExtension: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {CorrettoDistribution} =
|
||||
await import('../../src/distributions/corretto/installer.js');
|
||||
const util = await import('../../src/util.js');
|
||||
import manifestData from '../data/corretto.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: ReturnType<typeof jest.spyOn>;
|
||||
let spyGetDownloadArchiveExtension: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyGetDownloadArchiveExtension: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -65,11 +20,13 @@ describe('getAvailableVersions', () => {
|
||||
headers: {},
|
||||
result: manifestData
|
||||
});
|
||||
spyGetDownloadArchiveExtension =
|
||||
util.getDownloadArchiveExtension as jest.Mock;
|
||||
spyGetDownloadArchiveExtension = jest.spyOn(
|
||||
util,
|
||||
'getDownloadArchiveExtension'
|
||||
);
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -278,7 +235,7 @@ describe('getAvailableVersions', () => {
|
||||
});
|
||||
|
||||
const mockPlatform = (
|
||||
distribution: InstanceType<typeof CorrettoDistribution>,
|
||||
distribution: CorrettoDistribution,
|
||||
platform: string
|
||||
) => {
|
||||
distribution['getPlatformOption'] = () => platform;
|
||||
|
||||
@ -1,59 +1,14 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import {DragonwellDistribution} from '../../src/distributions/dragonwell/installer';
|
||||
import * as utils from '../../src/util';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/dragonwell.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
getDownloadArchiveExtension: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {DragonwellDistribution} =
|
||||
await import('../../src/distributions/dragonwell/installer.js');
|
||||
const utils = await import('../../src/util.js');
|
||||
import manifestData from '../data/dragonwell.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyUtilGetDownloadArchiveExtension: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -63,12 +18,14 @@ describe('getAvailableVersions', () => {
|
||||
result: manifestData
|
||||
});
|
||||
|
||||
spyUtilGetDownloadArchiveExtension =
|
||||
utils.getDownloadArchiveExtension as jest.Mock;
|
||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
||||
utils,
|
||||
'getDownloadArchiveExtension'
|
||||
);
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -79,7 +36,7 @@ describe('getAvailableVersions', () => {
|
||||
});
|
||||
|
||||
const mockPlatform = (
|
||||
distribution: InstanceType<typeof DragonwellDistribution>,
|
||||
distribution: DragonwellDistribution,
|
||||
platform: string
|
||||
) => {
|
||||
distribution['getPlatformOption'] = () => platform;
|
||||
|
||||
@ -1,116 +1,53 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as http from '@actions/http-client';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {
|
||||
GraalVMCommunityDistribution,
|
||||
GraalVMDistribution
|
||||
} from '../../src/distributions/graalvm/installer';
|
||||
import {getJavaDistribution} from '../../src/distributions/distribution-factory';
|
||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
||||
import * as util from '../../src/util';
|
||||
|
||||
// Mock @actions modules
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
jest.mock('@actions/core');
|
||||
jest.mock('@actions/tool-cache');
|
||||
jest.mock('@actions/http-client');
|
||||
|
||||
jest.unstable_mockModule('@actions/tool-cache', () => ({
|
||||
find: jest.fn(),
|
||||
findAllVersions: jest.fn(),
|
||||
downloadTool: jest.fn(),
|
||||
extractZip: jest.fn(),
|
||||
extractTar: jest.fn(),
|
||||
extract7z: jest.fn(),
|
||||
extractXar: jest.fn(),
|
||||
cacheDir: jest.fn(),
|
||||
cacheFile: jest.fn(),
|
||||
getManifestFromRepo: jest.fn(),
|
||||
findFromManifest: jest.fn(),
|
||||
evaluateVersions: jest.fn()
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('@actions/http-client', () => ({
|
||||
HttpClient: jest.fn().mockImplementation(() => ({
|
||||
getJson: jest.fn(),
|
||||
head: jest.fn(),
|
||||
get: jest.fn()
|
||||
})),
|
||||
HttpClientError: class HttpClientError extends Error {
|
||||
statusCode: number;
|
||||
constructor(message: string, statusCode: number) {
|
||||
super(message);
|
||||
this.statusCode = statusCode;
|
||||
}
|
||||
},
|
||||
HttpCodes: {OK: 200, NotFound: 404, Unauthorized: 401, Forbidden: 403}
|
||||
}));
|
||||
|
||||
// Get real util first, then mock specific functions
|
||||
const realUtil = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...realUtil,
|
||||
jest.mock('../../src/util', () => ({
|
||||
...jest.requireActual('../../src/util'),
|
||||
extractJdkFile: jest.fn(),
|
||||
getDownloadArchiveExtension: jest.fn(),
|
||||
renameWinArchive: jest.fn(),
|
||||
getGitHubHttpHeaders: jest.fn().mockReturnValue({Accept: 'application/json'})
|
||||
}));
|
||||
|
||||
const real_fs_module = await import('fs');
|
||||
jest.unstable_mockModule('fs', () => ({
|
||||
...real_fs_module,
|
||||
default: {
|
||||
...real_fs_module.default,
|
||||
readdirSync: jest.fn(),
|
||||
existsSync: jest.fn()
|
||||
},
|
||||
jest.mock('fs', () => ({
|
||||
...jest.requireActual('fs'),
|
||||
readdirSync: jest.fn(),
|
||||
existsSync: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const tc = await import('@actions/tool-cache');
|
||||
const http = await import('@actions/http-client');
|
||||
const fs = (await import('fs')).default;
|
||||
const util = await import('../../src/util.js');
|
||||
const {GraalVMCommunityDistribution, GraalVMDistribution} =
|
||||
await import('../../src/distributions/graalvm/installer.js');
|
||||
const {getJavaDistribution} =
|
||||
await import('../../src/distributions/distribution-factory.js');
|
||||
|
||||
import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
|
||||
|
||||
beforeAll(() => {
|
||||
process.env.NODE_ENV = 'test';
|
||||
|
||||
if (!jest.isMockFunction(http.HttpClient)) {
|
||||
throw new Error('HTTP client must be mocked in tests!');
|
||||
}
|
||||
|
||||
if (!jest.isMockFunction(tc.downloadTool)) {
|
||||
throw new Error('Tool cache downloadTool must be mocked in tests!');
|
||||
}
|
||||
|
||||
console.log('✅ All external dependencies are properly mocked');
|
||||
});
|
||||
|
||||
describe('GraalVMDistribution', () => {
|
||||
let distribution: InstanceType<typeof GraalVMDistribution>;
|
||||
let communityDistribution: InstanceType<typeof GraalVMCommunityDistribution>;
|
||||
let mockHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let distribution: GraalVMDistribution;
|
||||
let communityDistribution: GraalVMCommunityDistribution;
|
||||
let mockHttpClient: jest.Mocked<http.HttpClient>;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
const defaultOptions: JavaInstallerOptions = {
|
||||
version: '17',
|
||||
@ -125,20 +62,23 @@ describe('GraalVMDistribution', () => {
|
||||
distribution = new GraalVMDistribution(defaultOptions);
|
||||
communityDistribution = new GraalVMCommunityDistribution(defaultOptions);
|
||||
|
||||
mockHttpClient = new (http.HttpClient as any)();
|
||||
mockHttpClient = new http.HttpClient() as jest.Mocked<http.HttpClient>;
|
||||
(distribution as any).http = mockHttpClient;
|
||||
(communityDistribution as any).http = mockHttpClient;
|
||||
|
||||
(util.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||
'tar.gz'
|
||||
);
|
||||
(util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('tar.gz');
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
expect(jest.isMockFunction(http.HttpClient)).toBe(true);
|
||||
|
||||
expect(jest.isMockFunction(tc.downloadTool)).toBe(true);
|
||||
expect(jest.isMockFunction(tc.cacheDir)).toBe(true);
|
||||
|
||||
jest.restoreAllMocks();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
@ -173,24 +113,20 @@ describe('GraalVMDistribution', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
(tc.downloadTool as any).mockResolvedValue('/tmp/archive.tar.gz');
|
||||
(tc.cacheDir as any).mockResolvedValue('/cached/java/path');
|
||||
(tc.downloadTool as jest.Mock).mockResolvedValue('/tmp/archive.tar.gz');
|
||||
(tc.cacheDir as jest.Mock).mockResolvedValue('/cached/java/path');
|
||||
|
||||
(util.extractJdkFile as any).mockResolvedValue('/tmp/extracted');
|
||||
(util.extractJdkFile as jest.Mock).mockResolvedValue('/tmp/extracted');
|
||||
|
||||
// Mock renameWinArchive - it returns the same path (no renaming)
|
||||
(util.renameWinArchive as any).mockImplementation((p: string) => p);
|
||||
(util.renameWinArchive as jest.Mock).mockImplementation((p: string) => p);
|
||||
|
||||
(util.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||
'tar.gz'
|
||||
);
|
||||
(util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('tar.gz');
|
||||
|
||||
// Mock fs.existsSync to return true for extracted path
|
||||
(fs.existsSync as jest.Mock<any>).mockReturnValue(true);
|
||||
(fs.existsSync as jest.Mock).mockReturnValue(true);
|
||||
|
||||
(fs.readdirSync as jest.Mock<any>).mockReturnValue([
|
||||
'graalvm-jdk-17.0.5'
|
||||
]);
|
||||
(fs.readdirSync as jest.Mock).mockReturnValue(['graalvm-jdk-17.0.5']);
|
||||
|
||||
jest
|
||||
.spyOn(distribution as any, 'getToolcacheVersionName')
|
||||
@ -237,7 +173,7 @@ describe('GraalVMDistribution', () => {
|
||||
});
|
||||
|
||||
it('should throw error when extracted path does not exist', async () => {
|
||||
(fs.existsSync as jest.Mock<any>).mockReturnValue(false);
|
||||
(fs.existsSync as jest.Mock).mockReturnValue(false);
|
||||
|
||||
await expect(
|
||||
(distribution as any).downloadTool(javaRelease)
|
||||
@ -251,8 +187,8 @@ describe('GraalVMDistribution', () => {
|
||||
});
|
||||
|
||||
it('should throw error when extracted directory is empty', async () => {
|
||||
(fs.existsSync as jest.Mock<any>).mockReturnValue(true);
|
||||
(fs.readdirSync as jest.Mock<any>).mockReturnValue([]);
|
||||
(fs.existsSync as jest.Mock).mockReturnValue(true);
|
||||
(fs.readdirSync as jest.Mock).mockReturnValue([]);
|
||||
|
||||
await expect(
|
||||
(distribution as any).downloadTool(javaRelease)
|
||||
@ -267,7 +203,7 @@ describe('GraalVMDistribution', () => {
|
||||
|
||||
it('should handle download errors', async () => {
|
||||
const downloadError = new Error('Network error during download');
|
||||
(tc.downloadTool as any).mockRejectedValue(downloadError);
|
||||
(tc.downloadTool as jest.Mock).mockRejectedValue(downloadError);
|
||||
|
||||
await expect(
|
||||
(distribution as any).downloadTool(javaRelease)
|
||||
@ -280,7 +216,7 @@ describe('GraalVMDistribution', () => {
|
||||
|
||||
it('should handle extraction errors', async () => {
|
||||
const extractError = new Error('Failed to extract archive');
|
||||
(util.extractJdkFile as any).mockRejectedValue(extractError);
|
||||
(util.extractJdkFile as jest.Mock).mockRejectedValue(extractError);
|
||||
|
||||
await expect(
|
||||
(distribution as any).downloadTool(javaRelease)
|
||||
@ -293,10 +229,8 @@ describe('GraalVMDistribution', () => {
|
||||
|
||||
it('should handle different archive extensions', async () => {
|
||||
// Test with a .zip file
|
||||
(util.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||
'zip'
|
||||
);
|
||||
(tc.downloadTool as any).mockResolvedValue('/tmp/archive.zip');
|
||||
(util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('zip');
|
||||
(tc.downloadTool as jest.Mock).mockResolvedValue('/tmp/archive.zip');
|
||||
|
||||
const zipRelease = {
|
||||
version: '17.0.5',
|
||||
@ -375,7 +309,7 @@ describe('GraalVMDistribution', () => {
|
||||
it('should construct correct URL for specific version', async () => {
|
||||
const mockResponse = {
|
||||
message: {statusCode: 200}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
const result = await (distribution as any).findPackageForDownload(
|
||||
@ -392,7 +326,7 @@ describe('GraalVMDistribution', () => {
|
||||
it('should construct correct URL for major version (latest)', async () => {
|
||||
const mockResponse = {
|
||||
message: {statusCode: 200}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
const result = await (distribution as any).findPackageForDownload('21');
|
||||
@ -440,7 +374,7 @@ describe('GraalVMDistribution', () => {
|
||||
it('should throw error when file not found (404)', async () => {
|
||||
const mockResponse = {
|
||||
message: {statusCode: 404}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
// Verify the error is thrown with the expected message
|
||||
@ -461,7 +395,7 @@ describe('GraalVMDistribution', () => {
|
||||
it('should throw error for unauthorized access (401)', async () => {
|
||||
const mockResponse = {
|
||||
message: {statusCode: 401}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
await expect(
|
||||
@ -474,7 +408,7 @@ describe('GraalVMDistribution', () => {
|
||||
it('should throw error for forbidden access (403)', async () => {
|
||||
const mockResponse = {
|
||||
message: {statusCode: 403}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
await expect(
|
||||
@ -490,7 +424,7 @@ describe('GraalVMDistribution', () => {
|
||||
statusCode: 500,
|
||||
statusMessage: 'Internal Server Error'
|
||||
}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
await expect(
|
||||
@ -503,7 +437,7 @@ describe('GraalVMDistribution', () => {
|
||||
it('should throw error for other HTTP errors without status message', async () => {
|
||||
const mockResponse = {
|
||||
message: {statusCode: 500}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
await expect(
|
||||
@ -779,7 +713,7 @@ describe('GraalVMDistribution', () => {
|
||||
}
|
||||
];
|
||||
|
||||
let fetchEASpy: any;
|
||||
let fetchEASpy: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
fetchEASpy = jest.spyOn(distribution as any, 'fetchEAJson');
|
||||
@ -998,7 +932,7 @@ describe('GraalVMDistribution', () => {
|
||||
|
||||
const mockResponse = {
|
||||
message: {statusCode: 200}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
const result = await (distribution as any).findPackageForDownload('17');
|
||||
@ -1026,7 +960,7 @@ describe('GraalVMDistribution', () => {
|
||||
|
||||
const mockResponse = {
|
||||
message: {statusCode: 200}
|
||||
} as any;
|
||||
} as http.HttpClientResponse;
|
||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||
|
||||
const result = await (distribution as any).findPackageForDownload('17');
|
||||
|
||||
@ -1,53 +1,14 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import https from 'https';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import {JetBrainsDistribution} from '../../src/distributions/jetbrains/installer';
|
||||
|
||||
import manifestData from '../data/jetbrains.json' with {type: 'json'};
|
||||
import manifestData from '../data/jetbrains.json';
|
||||
import os from 'os';
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {JetBrainsDistribution} =
|
||||
await import('../../src/distributions/jetbrains/installer.js');
|
||||
import * as core from '@actions/core';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -58,7 +19,7 @@ describe('getAvailableVersions', () => {
|
||||
});
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -70,17 +31,11 @@ describe('getAvailableVersions', () => {
|
||||
|
||||
it('load available versions', async () => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient
|
||||
.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData as any
|
||||
})
|
||||
.mockReturnValue({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: []
|
||||
});
|
||||
spyHttpClient.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData as any
|
||||
});
|
||||
|
||||
const distribution = new JetBrainsDistribution({
|
||||
version: '17',
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {KonaDistribution} from '../../src/distributions/kona/installer.js';
|
||||
import {KonaDistribution} from '../../src/distributions/kona/installer';
|
||||
|
||||
import manifestData from '../data/kona.json' with {type: 'json'};
|
||||
import manifestData from '../data/kona.json';
|
||||
|
||||
function mockDistr(
|
||||
version: string,
|
||||
|
||||
@ -1,56 +1,17 @@
|
||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {
|
||||
ArchitectureOptions,
|
||||
LibericaVersion
|
||||
} from '../../src/distributions/liberica/models.js';
|
||||
} from '../../src/distributions/liberica/models';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/liberica.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {LibericaDistributions} =
|
||||
await import('../../src/distributions/liberica/installer.js');
|
||||
import manifestData from '../data/liberica.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -61,7 +22,7 @@ describe('getAvailableVersions', () => {
|
||||
});
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -223,7 +184,7 @@ describe('getArchitectureOptions', () => {
|
||||
});
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
let distribution: InstanceType<typeof LibericaDistributions>;
|
||||
let distribution: LibericaDistributions;
|
||||
|
||||
beforeEach(() => {
|
||||
distribution = new LibericaDistributions({
|
||||
|
||||
@ -1,56 +1,17 @@
|
||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {
|
||||
ArchitectureOptions,
|
||||
LibericaVersion
|
||||
} from '../../src/distributions/liberica/models.js';
|
||||
} from '../../src/distributions/liberica/models';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/liberica-linux.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {LibericaDistributions} =
|
||||
await import('../../src/distributions/liberica/installer.js');
|
||||
import manifestData from '../data/liberica-linux.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -61,7 +22,7 @@ describe('getAvailableVersions', () => {
|
||||
});
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -223,7 +184,7 @@ describe('getArchitectureOptions', () => {
|
||||
});
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
let distribution: InstanceType<typeof LibericaDistributions>;
|
||||
let distribution: LibericaDistributions;
|
||||
|
||||
beforeEach(() => {
|
||||
distribution = new LibericaDistributions({
|
||||
|
||||
@ -1,56 +1,17 @@
|
||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {
|
||||
ArchitectureOptions,
|
||||
LibericaVersion
|
||||
} from '../../src/distributions/liberica/models.js';
|
||||
} from '../../src/distributions/liberica/models';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/liberica-windows.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {LibericaDistributions} =
|
||||
await import('../../src/distributions/liberica/installer.js');
|
||||
import manifestData from '../data/liberica-windows.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -60,7 +21,7 @@ describe('getAvailableVersions', () => {
|
||||
result: manifestData as LibericaVersion[]
|
||||
});
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -222,7 +183,7 @@ describe('getArchitectureOptions', () => {
|
||||
});
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
let distribution: InstanceType<typeof LibericaDistributions>;
|
||||
let distribution: LibericaDistributions;
|
||||
|
||||
beforeEach(() => {
|
||||
distribution = new LibericaDistributions({
|
||||
|
||||
@ -1,101 +1,37 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import fs from 'fs';
|
||||
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import path from 'path';
|
||||
import * as semver from 'semver';
|
||||
import * as util from '../../src/util';
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('@actions/tool-cache', () => ({
|
||||
find: jest.fn(),
|
||||
findAllVersions: jest.fn(),
|
||||
downloadTool: jest.fn(),
|
||||
extractZip: jest.fn(),
|
||||
extractTar: jest.fn(),
|
||||
extract7z: jest.fn(),
|
||||
extractXar: jest.fn(),
|
||||
cacheDir: jest.fn(),
|
||||
cacheFile: jest.fn(),
|
||||
getManifestFromRepo: jest.fn(),
|
||||
findFromManifest: jest.fn(),
|
||||
evaluateVersions: jest.fn()
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
extractJdkFile: jest.fn(),
|
||||
getDownloadArchiveExtension: jest.fn(),
|
||||
getToolcachePath: jest.fn(),
|
||||
isJobStatusSuccess: jest.fn(),
|
||||
renameWinArchive: jest.fn(),
|
||||
isVersionSatisfies: real_util_module.isVersionSatisfies,
|
||||
getTempDir: real_util_module.getTempDir
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const tc = await import('@actions/tool-cache');
|
||||
const util = await import('../../src/util.js');
|
||||
const {LocalDistribution} =
|
||||
await import('../../src/distributions/local/installer.js');
|
||||
import {LocalDistribution} from '../../src/distributions/local/installer';
|
||||
|
||||
describe('setupJava', () => {
|
||||
const actualJavaVersion = '11.1.10';
|
||||
const javaPath = path.join('Java_jdkfile_jdk', actualJavaVersion, 'x86');
|
||||
|
||||
let mockJavaBase: InstanceType<typeof LocalDistribution>;
|
||||
let mockJavaBase: LocalDistribution;
|
||||
|
||||
let spyGetToolcachePath: any;
|
||||
let spyTcCacheDir: any;
|
||||
let spyTcFindAllVersions: any;
|
||||
let spyCoreDebug: any;
|
||||
let spyCoreInfo: any;
|
||||
let spyCoreExportVariable: any;
|
||||
let spyCoreAddPath: any;
|
||||
let spyCoreSetOutput: any;
|
||||
let spyFsStat: any;
|
||||
let spyFsReadDir: any;
|
||||
let spyUtilsExtractJdkFile: any;
|
||||
let spyPathResolve: any;
|
||||
let spyCoreError: any;
|
||||
let spyGetToolcachePath: jest.SpyInstance;
|
||||
let spyTcCacheDir: jest.SpyInstance;
|
||||
let spyTcFindAllVersions: jest.SpyInstance;
|
||||
let spyCoreDebug: jest.SpyInstance;
|
||||
let spyCoreInfo: jest.SpyInstance;
|
||||
let spyCoreExportVariable: jest.SpyInstance;
|
||||
let spyCoreAddPath: jest.SpyInstance;
|
||||
let spyCoreSetOutput: jest.SpyInstance;
|
||||
let spyFsStat: jest.SpyInstance;
|
||||
let spyFsReadDir: jest.SpyInstance;
|
||||
let spyUtilsExtractJdkFile: jest.SpyInstance;
|
||||
let spyPathResolve: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
const expectedJdkFile = 'JavaLocalJdkFile';
|
||||
|
||||
beforeEach(() => {
|
||||
spyGetToolcachePath = util.getToolcachePath as jest.Mock;
|
||||
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
||||
spyGetToolcachePath.mockImplementation(
|
||||
(toolname: string, javaVersion: string, architecture: string) => {
|
||||
const semverVersion = new semver.Range(javaVersion);
|
||||
@ -113,7 +49,7 @@ describe('setupJava', () => {
|
||||
}
|
||||
);
|
||||
|
||||
spyTcCacheDir = tc.cacheDir as jest.Mock;
|
||||
spyTcCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||
spyTcCacheDir.mockImplementation(
|
||||
(
|
||||
archivePath: string,
|
||||
@ -123,23 +59,23 @@ describe('setupJava', () => {
|
||||
) => path.join(toolcacheFolderName, version, architecture)
|
||||
);
|
||||
|
||||
spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
|
||||
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
||||
spyTcFindAllVersions.mockReturnValue([actualJavaVersion]);
|
||||
|
||||
// Spy on core methods
|
||||
spyCoreDebug = core.debug as jest.Mock;
|
||||
spyCoreDebug = jest.spyOn(core, 'debug');
|
||||
spyCoreDebug.mockImplementation(() => undefined);
|
||||
|
||||
spyCoreInfo = core.info as jest.Mock;
|
||||
spyCoreInfo = jest.spyOn(core, 'info');
|
||||
spyCoreInfo.mockImplementation(() => undefined);
|
||||
|
||||
spyCoreAddPath = core.addPath as jest.Mock;
|
||||
spyCoreAddPath = jest.spyOn(core, 'addPath');
|
||||
spyCoreAddPath.mockImplementation(() => undefined);
|
||||
|
||||
spyCoreExportVariable = core.exportVariable as jest.Mock;
|
||||
spyCoreExportVariable = jest.spyOn(core, 'exportVariable');
|
||||
spyCoreExportVariable.mockImplementation(() => undefined);
|
||||
|
||||
spyCoreSetOutput = core.setOutput as jest.Mock;
|
||||
spyCoreSetOutput = jest.spyOn(core, 'setOutput');
|
||||
spyCoreSetOutput.mockImplementation(() => undefined);
|
||||
|
||||
// Spy on fs methods
|
||||
@ -152,7 +88,7 @@ describe('setupJava', () => {
|
||||
});
|
||||
|
||||
// Spy on util methods
|
||||
spyUtilsExtractJdkFile = util.extractJdkFile as jest.Mock;
|
||||
spyUtilsExtractJdkFile = jest.spyOn(util, 'extractJdkFile');
|
||||
spyUtilsExtractJdkFile.mockImplementation(() => 'some/random/path/');
|
||||
|
||||
// Spy on path methods
|
||||
@ -160,7 +96,7 @@ describe('setupJava', () => {
|
||||
spyPathResolve.mockImplementation((path: string) => path);
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
|
||||
@ -1,115 +1,23 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import data from '../data/microsoft.json' with {type: 'json'};
|
||||
|
||||
const mockOsArch = jest.fn(() => 'x64');
|
||||
const mockOsPlatform = jest.fn(() => 'linux');
|
||||
|
||||
const real_os_module = await import('os');
|
||||
jest.unstable_mockModule('os', () => ({
|
||||
...real_os_module,
|
||||
default: {
|
||||
...real_os_module.default,
|
||||
arch: mockOsArch,
|
||||
platform: mockOsPlatform,
|
||||
homedir: real_os_module.default.homedir
|
||||
},
|
||||
arch: mockOsArch,
|
||||
platform: mockOsPlatform
|
||||
}));
|
||||
|
||||
const real_fs_module = await import('fs');
|
||||
const mockReaddirSync = jest.fn();
|
||||
jest.unstable_mockModule('fs', () => ({
|
||||
...real_fs_module,
|
||||
default: {
|
||||
...real_fs_module.default,
|
||||
readdirSync: mockReaddirSync
|
||||
},
|
||||
readdirSync: mockReaddirSync
|
||||
}));
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const real_tc_module = await import('@actions/tool-cache');
|
||||
jest.unstable_mockModule('@actions/tool-cache', () => ({
|
||||
...real_tc_module,
|
||||
downloadTool: jest.fn(),
|
||||
cacheDir: jest.fn(),
|
||||
cacheFile: jest.fn()
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
extractJdkFile: jest.fn(),
|
||||
getDownloadArchiveExtension: jest.fn(),
|
||||
getToolcachePath: jest.fn(),
|
||||
isJobStatusSuccess: jest.fn(),
|
||||
renameWinArchive: jest.fn(),
|
||||
isVersionSatisfies: real_util_module.isVersionSatisfies,
|
||||
getTempDir: real_util_module.getTempDir
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('../../src/gpg.js', () => ({
|
||||
importKey: jest.fn(),
|
||||
deleteKey: jest.fn(),
|
||||
verifyPackageSignature: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const gpg = await import('../../src/gpg.js');
|
||||
const tc = await import('@actions/tool-cache');
|
||||
const os = (await import('os')).default;
|
||||
const fs = (await import('fs')).default;
|
||||
const {MicrosoftDistributions, MICROSOFT_PUBLIC_KEY} =
|
||||
await import('../../src/distributions/microsoft/installer.js');
|
||||
const util = await import('../../src/util.js');
|
||||
MicrosoftDistributions,
|
||||
MICROSOFT_PUBLIC_KEY
|
||||
} from '../../src/distributions/microsoft/installer';
|
||||
import os from 'os';
|
||||
import data from '../data/microsoft.json';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as gpg from '../../src/gpg';
|
||||
import * as util from '../../src/util';
|
||||
import fs from 'fs';
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
let distribution: InstanceType<typeof MicrosoftDistributions>;
|
||||
let spyGetManifestFromRepo: any;
|
||||
let spyDebug: any;
|
||||
let spyCoreError: any;
|
||||
let distribution: MicrosoftDistributions;
|
||||
let spyGetManifestFromRepo: jest.SpyInstance;
|
||||
let spyDebug: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
mockOsArch.mockReturnValue('x64');
|
||||
mockOsPlatform.mockReturnValue(process.platform);
|
||||
|
||||
distribution = new MicrosoftDistributions({
|
||||
version: '',
|
||||
architecture: 'x64',
|
||||
@ -117,18 +25,18 @@ describe('findPackageForDownload', () => {
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
spyGetManifestFromRepo = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyGetManifestFromRepo = jest.spyOn(httpm.HttpClient.prototype, 'getJson');
|
||||
spyGetManifestFromRepo.mockReturnValue({
|
||||
result: data,
|
||||
statusCode: 200,
|
||||
headers: {}
|
||||
});
|
||||
|
||||
spyDebug = core.debug as jest.Mock;
|
||||
spyDebug = jest.spyOn(core, 'debug');
|
||||
spyDebug.mockImplementation(() => {});
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -210,8 +118,10 @@ describe('findPackageForDownload', () => {
|
||||
])(
|
||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||
async (osArch: string, distroArch: string) => {
|
||||
mockOsArch.mockReturnValue(osArch);
|
||||
mockOsPlatform.mockReturnValue('darwin');
|
||||
jest
|
||||
.spyOn(os, 'arch')
|
||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||
jest.spyOn(os, 'platform').mockReturnValue('darwin');
|
||||
|
||||
const version = '17';
|
||||
const distro = new MicrosoftDistributions({
|
||||
@ -234,8 +144,10 @@ describe('findPackageForDownload', () => {
|
||||
])(
|
||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||
async (osArch: string, distroArch: string) => {
|
||||
mockOsArch.mockReturnValue(osArch);
|
||||
mockOsPlatform.mockReturnValue('linux');
|
||||
jest
|
||||
.spyOn(os, 'arch')
|
||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
||||
|
||||
const version = '17';
|
||||
const distro = new MicrosoftDistributions({
|
||||
@ -258,8 +170,10 @@ describe('findPackageForDownload', () => {
|
||||
])(
|
||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||
async (osArch: string, distroArch: string) => {
|
||||
mockOsArch.mockReturnValue(osArch);
|
||||
mockOsPlatform.mockReturnValue('win32');
|
||||
jest
|
||||
.spyOn(os, 'arch')
|
||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||
jest.spyOn(os, 'platform').mockReturnValue('win32');
|
||||
|
||||
const version = '17';
|
||||
const distro = new MicrosoftDistributions({
|
||||
@ -303,7 +217,7 @@ describe('findPackageForDownload', () => {
|
||||
statusCode: 200,
|
||||
headers: {}
|
||||
});
|
||||
mockOsPlatform.mockReturnValue('linux');
|
||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
||||
|
||||
const result = await distribution['findPackageForDownload']('17.0.10');
|
||||
|
||||
@ -314,14 +228,16 @@ describe('findPackageForDownload', () => {
|
||||
});
|
||||
|
||||
describe('downloadTool', () => {
|
||||
let spyDownloadTool: any;
|
||||
let spyExtractJdkFile: any;
|
||||
let spyCacheDir: any;
|
||||
let spyVerifySignature: any;
|
||||
let distribution: InstanceType<typeof MicrosoftDistributions>;
|
||||
let spyDownloadTool: jest.SpyInstance;
|
||||
let spyExtractJdkFile: jest.SpyInstance;
|
||||
let spyCacheDir: jest.SpyInstance;
|
||||
let spyVerifySignature: jest.SpyInstance;
|
||||
let distribution: MicrosoftDistributions;
|
||||
|
||||
beforeEach(() => {
|
||||
mockOsPlatform.mockReturnValue(process.platform);
|
||||
jest
|
||||
.spyOn(os, 'platform')
|
||||
.mockReturnValue(process.platform as ReturnType<typeof os.platform>);
|
||||
|
||||
distribution = new MicrosoftDistributions({
|
||||
version: '17',
|
||||
@ -330,27 +246,27 @@ describe('downloadTool', () => {
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
spyDownloadTool = tc.downloadTool as jest.Mock;
|
||||
spyDownloadTool = jest.spyOn(tc, 'downloadTool');
|
||||
spyDownloadTool.mockImplementation(async () => {
|
||||
return '/tmp/jdk.tar.gz';
|
||||
});
|
||||
|
||||
spyExtractJdkFile = util.extractJdkFile as jest.Mock;
|
||||
spyExtractJdkFile = jest.spyOn(util, 'extractJdkFile');
|
||||
spyExtractJdkFile.mockImplementation(async () => {
|
||||
return '/tmp/unpacked';
|
||||
});
|
||||
|
||||
mockReaddirSync.mockReturnValue(['jdk'] as any);
|
||||
spyCacheDir = tc.cacheDir as jest.Mock;
|
||||
jest.spyOn(fs, 'readdirSync').mockReturnValue(['jdk'] as any);
|
||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||
spyCacheDir.mockImplementation(async () => {
|
||||
return '/tmp/cached';
|
||||
});
|
||||
|
||||
(util.renameWinArchive as jest.Mock<any>).mockImplementation(
|
||||
(archivePath: string) => `${archivePath}.zip`
|
||||
);
|
||||
jest
|
||||
.spyOn(util, 'renameWinArchive')
|
||||
.mockImplementation((archivePath: string) => `${archivePath}.zip`);
|
||||
|
||||
spyVerifySignature = gpg.verifyPackageSignature as jest.Mock;
|
||||
spyVerifySignature = jest.spyOn(gpg, 'verifyPackageSignature');
|
||||
spyVerifySignature.mockImplementation(async () => {});
|
||||
});
|
||||
|
||||
|
||||
@ -1,53 +1,14 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import {OracleDistribution} from '../../src/distributions/oracle/installer';
|
||||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
import {getDownloadArchiveExtension} from '../../src/util';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {OracleDistribution} =
|
||||
await import('../../src/distributions/oracle/installer.js');
|
||||
const {getDownloadArchiveExtension} = await import('../../src/util.js');
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
let distribution: InstanceType<typeof OracleDistribution>;
|
||||
let spyDebug: any;
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let distribution: OracleDistribution;
|
||||
let spyDebug: jest.SpyInstance;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
distribution = new OracleDistribution({
|
||||
@ -57,11 +18,11 @@ describe('findPackageForDownload', () => {
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
spyDebug = core.debug as jest.Mock;
|
||||
spyDebug = jest.spyOn(core, 'debug');
|
||||
spyDebug.mockImplementation(() => {});
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
|
||||
@ -1,59 +1,14 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import {SapMachineDistribution} from '../../src/distributions/sapmachine/installer';
|
||||
import * as utils from '../../src/util';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/sapmachine.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
getDownloadArchiveExtension: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {SapMachineDistribution} =
|
||||
await import('../../src/distributions/sapmachine/installer.js');
|
||||
const utils = await import('../../src/util.js');
|
||||
import manifestData from '../data/sapmachine.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyUtilGetDownloadArchiveExtension: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -63,12 +18,14 @@ describe('getAvailableVersions', () => {
|
||||
result: manifestData
|
||||
});
|
||||
|
||||
spyUtilGetDownloadArchiveExtension =
|
||||
utils.getDownloadArchiveExtension as jest.Mock<any>;
|
||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
||||
utils,
|
||||
'getDownloadArchiveExtension'
|
||||
);
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -79,7 +36,7 @@ describe('getAvailableVersions', () => {
|
||||
});
|
||||
|
||||
const mockPlatform = (
|
||||
distribution: InstanceType<typeof SapMachineDistribution>,
|
||||
distribution: SapMachineDistribution,
|
||||
platform: string
|
||||
) => {
|
||||
distribution['getPlatformOption'] = () => platform;
|
||||
|
||||
@ -1,53 +1,15 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
|
||||
import manifestData from '../data/semeru.json' with {type: 'json'};
|
||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
||||
import {SemeruDistribution} from '../../src/distributions/semeru/installer';
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {SemeruDistribution} =
|
||||
await import('../../src/distributions/semeru/installer.js');
|
||||
import manifestData from '../data/semeru.json';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyCoreWarning: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
let spyCoreWarning: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -57,9 +19,9 @@ describe('getAvailableVersions', () => {
|
||||
result: []
|
||||
});
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
spyCoreWarning = core.warning as jest.Mock;
|
||||
spyCoreWarning = jest.spyOn(core, 'warning');
|
||||
spyCoreWarning.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
|
||||
@ -1,92 +1,23 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {JavaInstallerOptions} from '../../src/distributions/base-models.js';
|
||||
import type {TemurinImplementation as TemurinImplementationType} from '../../src/distributions/temurin/installer.js';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import {
|
||||
TemurinDistribution,
|
||||
TemurinImplementation,
|
||||
ADOPTIUM_PUBLIC_KEY
|
||||
} from '../../src/distributions/temurin/installer';
|
||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
||||
import * as util from '../../src/util';
|
||||
import * as gpg from '../../src/gpg';
|
||||
|
||||
import manifestData from '../data/temurin.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('@actions/tool-cache', () => ({
|
||||
find: jest.fn(),
|
||||
findAllVersions: jest.fn(),
|
||||
downloadTool: jest.fn(),
|
||||
extractZip: jest.fn(),
|
||||
extractTar: jest.fn(),
|
||||
extract7z: jest.fn(),
|
||||
extractXar: jest.fn(),
|
||||
cacheDir: jest.fn(),
|
||||
cacheFile: jest.fn(),
|
||||
getManifestFromRepo: jest.fn(),
|
||||
findFromManifest: jest.fn(),
|
||||
evaluateVersions: jest.fn()
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
extractJdkFile: jest.fn(),
|
||||
getDownloadArchiveExtension: jest.fn(),
|
||||
getToolcachePath: jest.fn(),
|
||||
isJobStatusSuccess: jest.fn(),
|
||||
renameWinArchive: jest.fn(),
|
||||
isVersionSatisfies: real_util_module.isVersionSatisfies,
|
||||
getTempDir: real_util_module.getTempDir
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('../../src/gpg.js', () => ({
|
||||
importKey: jest.fn(),
|
||||
deleteKey: jest.fn(),
|
||||
verifyPackageSignature: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const gpg = await import('../../src/gpg.js');
|
||||
const tc = await import('@actions/tool-cache');
|
||||
const {TemurinDistribution, TemurinImplementation, ADOPTIUM_PUBLIC_KEY} =
|
||||
await import('../../src/distributions/temurin/installer.js');
|
||||
const util = await import('../../src/util.js');
|
||||
import manifestData from '../data/temurin.json';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyCoreWarning: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
let spyCoreWarning: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
@ -96,9 +27,9 @@ describe('getAvailableVersions', () => {
|
||||
result: []
|
||||
});
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
spyCoreWarning = core.warning as jest.Mock;
|
||||
spyCoreWarning = jest.spyOn(core, 'warning');
|
||||
spyCoreWarning.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -153,7 +84,7 @@ describe('getAvailableVersions', () => {
|
||||
'build correct url for %s',
|
||||
async (
|
||||
installerOptions: JavaInstallerOptions,
|
||||
impl: TemurinImplementationType,
|
||||
impl: TemurinImplementation,
|
||||
expectedParameters
|
||||
) => {
|
||||
const distribution = new TemurinDistribution(installerOptions, impl);
|
||||
@ -232,11 +163,7 @@ describe('getAvailableVersions', () => {
|
||||
[TemurinImplementation.Hotspot, 'jre', 'Java_Temurin-Hotspot_jre']
|
||||
])(
|
||||
'find right toolchain folder',
|
||||
(
|
||||
impl: TemurinImplementationType,
|
||||
packageType: string,
|
||||
expected: string
|
||||
) => {
|
||||
(impl: TemurinImplementation, packageType: string, expected: string) => {
|
||||
const distribution = new TemurinDistribution(
|
||||
{
|
||||
version: '8',
|
||||
@ -362,25 +289,25 @@ describe('findPackageForDownload', () => {
|
||||
});
|
||||
|
||||
describe('downloadTool', () => {
|
||||
let spyDownloadTool: any;
|
||||
let spyVerifySignature: any;
|
||||
let spyExtractJdkFile: any;
|
||||
let spyCacheDir: any;
|
||||
let spyReadDirSync: any;
|
||||
let spyRenameWinArchive: any;
|
||||
let spyDownloadTool: jest.SpyInstance;
|
||||
let spyVerifySignature: jest.SpyInstance;
|
||||
let spyExtractJdkFile: jest.SpyInstance;
|
||||
let spyCacheDir: jest.SpyInstance;
|
||||
let spyReadDirSync: jest.SpyInstance;
|
||||
let spyRenameWinArchive: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyDownloadTool = tc.downloadTool as jest.Mock;
|
||||
spyDownloadTool = jest.spyOn(tc, 'downloadTool');
|
||||
spyDownloadTool.mockResolvedValue('/tmp/jdk.tar.gz');
|
||||
spyVerifySignature = gpg.verifyPackageSignature as jest.Mock;
|
||||
spyVerifySignature = jest.spyOn(gpg, 'verifyPackageSignature');
|
||||
spyVerifySignature.mockResolvedValue(undefined);
|
||||
spyExtractJdkFile = util.extractJdkFile as jest.Mock;
|
||||
spyExtractJdkFile = jest.spyOn(util, 'extractJdkFile');
|
||||
spyExtractJdkFile.mockResolvedValue('/tmp/extracted');
|
||||
spyCacheDir = tc.cacheDir as jest.Mock;
|
||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||
spyCacheDir.mockResolvedValue('/tmp/toolcache');
|
||||
spyReadDirSync = jest.spyOn(fs, 'readdirSync');
|
||||
spyReadDirSync.mockReturnValue(['jdk-17'] as any);
|
||||
spyRenameWinArchive = util.renameWinArchive as jest.Mock;
|
||||
spyRenameWinArchive = jest.spyOn(util, 'renameWinArchive');
|
||||
spyRenameWinArchive.mockReturnValue('/tmp/jdk.tar.gz.zip');
|
||||
});
|
||||
|
||||
|
||||
@ -1,75 +1,33 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {IZuluVersions} from '../../src/distributions/zulu/models.js';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import {ZuluDistribution} from '../../src/distributions/zulu/installer';
|
||||
import {IZuluVersions} from '../../src/distributions/zulu/models';
|
||||
import * as utils from '../../src/util';
|
||||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/zulu-releases-default.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
getDownloadArchiveExtension: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {ZuluDistribution} =
|
||||
await import('../../src/distributions/zulu/installer.js');
|
||||
const utils = await import('../../src/util.js');
|
||||
import manifestData from '../data/zulu-releases-default.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockReturnValue({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: [] as IZuluVersions[]
|
||||
result: manifestData as IZuluVersions[]
|
||||
});
|
||||
|
||||
(utils.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||
'tar.gz'
|
||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
||||
utils,
|
||||
'getDownloadArchiveExtension'
|
||||
);
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -87,7 +45,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -96,7 +54,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ea&availability_types=ca&page=1&page_size=100'
|
||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -105,7 +63,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -114,7 +72,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jre',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jre&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=macos&ext=tar.gz&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -123,7 +81,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk+fx',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -132,16 +90,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jre+fx',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jre&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
],
|
||||
[
|
||||
{
|
||||
version: '8',
|
||||
architecture: 'x64',
|
||||
packageType: 'jdk+crac',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=true&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=macos&ext=tar.gz&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -150,7 +99,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=aarch64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -159,12 +108,12 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=arm&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
|
||||
]
|
||||
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
||||
const distribution = new ZuluDistribution(input);
|
||||
distribution['getPlatformOption'] = () => 'macos';
|
||||
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
|
||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
|
||||
|
||||
await distribution['getAvailableVersions']();
|
||||
|
||||
@ -172,12 +121,16 @@ describe('getAvailableVersions', () => {
|
||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||
});
|
||||
|
||||
type DistroArch = {
|
||||
bitness: string;
|
||||
arch: string;
|
||||
};
|
||||
it.each([
|
||||
['amd64', 'x64'],
|
||||
['arm64', 'aarch64']
|
||||
['amd64', {bitness: '64', arch: 'x86'}],
|
||||
['arm64', {bitness: '64', arch: 'arm'}]
|
||||
])(
|
||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||
async (osArch: string, distroArch: string) => {
|
||||
async (osArch: string, distroArch: DistroArch) => {
|
||||
jest
|
||||
.spyOn(os, 'arch')
|
||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||
@ -189,7 +142,7 @@ describe('getAvailableVersions', () => {
|
||||
checkLatest: false
|
||||
});
|
||||
distribution['getPlatformOption'] = () => 'macos';
|
||||
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/?os=macos&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=${distroArch}&release_status=ga&availability_types=ca&page=1&page_size=100`;
|
||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=${distroArch.arch}&hw_bitness=${distroArch.bitness}&release_status=ga`;
|
||||
|
||||
await distribution['getAvailableVersions']();
|
||||
|
||||
@ -199,18 +152,6 @@ describe('getAvailableVersions', () => {
|
||||
);
|
||||
|
||||
it('load available versions', async () => {
|
||||
spyHttpClient
|
||||
.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData as IZuluVersions[]
|
||||
})
|
||||
.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: [] as IZuluVersions[]
|
||||
});
|
||||
|
||||
const distribution = new ZuluDistribution({
|
||||
version: '11',
|
||||
architecture: 'x86',
|
||||
@ -224,11 +165,10 @@ describe('getAvailableVersions', () => {
|
||||
|
||||
describe('getArchitectureOptions', () => {
|
||||
it.each([
|
||||
[{architecture: 'x64'}, 'x64'],
|
||||
[{architecture: 'x86'}, 'i686'],
|
||||
[{architecture: 'aarch64'}, 'aarch64'],
|
||||
[{architecture: 'arm64'}, 'aarch64'],
|
||||
[{architecture: 'arm'}, 'arm']
|
||||
[{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
|
||||
[{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
|
||||
[{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
|
||||
[{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
|
||||
])('%s -> %s', (input, expected) => {
|
||||
const distribution = new ZuluDistribution({
|
||||
version: '11',
|
||||
@ -236,7 +176,7 @@ describe('getArchitectureOptions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
expect(distribution['getArchitectureOptions']()).toBe(expected);
|
||||
expect(distribution['getArchitectureOptions']()).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,77 +1,34 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {IZuluVersions} from '../../src/distributions/zulu/models.js';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import * as semver from 'semver';
|
||||
import {ZuluDistribution} from '../../src/distributions/zulu/installer';
|
||||
import {IZuluVersions} from '../../src/distributions/zulu/models';
|
||||
import * as utils from '../../src/util';
|
||||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/zulu-linux.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
getDownloadArchiveExtension: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {ZuluDistribution} =
|
||||
await import('../../src/distributions/zulu/installer.js');
|
||||
const utils = await import('../../src/util.js');
|
||||
import manifestData from '../data/zulu-linux.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyUtilGetDownloadArchiveExtension: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockReturnValue({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: [] as IZuluVersions[]
|
||||
result: manifestData as IZuluVersions[]
|
||||
});
|
||||
|
||||
spyUtilGetDownloadArchiveExtension =
|
||||
utils.getDownloadArchiveExtension as jest.Mock<any>;
|
||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
||||
utils,
|
||||
'getDownloadArchiveExtension'
|
||||
);
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -89,7 +46,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -98,7 +55,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ea&availability_types=ca&page=1&page_size=100'
|
||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -107,7 +64,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -116,7 +73,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jre',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jre&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=linux&ext=zip&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -125,7 +82,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk+fx',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -134,16 +91,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jre+fx',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jre&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
],
|
||||
[
|
||||
{
|
||||
version: '8',
|
||||
architecture: 'x64',
|
||||
packageType: 'jdk+crac',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=true&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=linux&ext=zip&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -152,7 +100,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=aarch64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -161,12 +109,12 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=linux_glibc&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=arm&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
|
||||
]
|
||||
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
||||
const distribution = new ZuluDistribution(input);
|
||||
distribution['getPlatformOption'] = () => 'linux_glibc';
|
||||
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
|
||||
distribution['getPlatformOption'] = () => 'linux';
|
||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
|
||||
|
||||
await distribution['getAvailableVersions']();
|
||||
|
||||
@ -174,12 +122,16 @@ describe('getAvailableVersions', () => {
|
||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||
});
|
||||
|
||||
type DistroArch = {
|
||||
bitness: string;
|
||||
arch: string;
|
||||
};
|
||||
it.each([
|
||||
['amd64', 'x64'],
|
||||
['arm64', 'aarch64']
|
||||
['amd64', {bitness: '64', arch: 'x86'}],
|
||||
['arm64', {bitness: '64', arch: 'arm'}]
|
||||
])(
|
||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||
async (osArch: string, distroArch: string) => {
|
||||
async (osArch: string, distroArch: DistroArch) => {
|
||||
jest
|
||||
.spyOn(os, 'arch')
|
||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||
@ -190,10 +142,10 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
distribution['getPlatformOption'] = () => 'linux_glibc';
|
||||
distribution['getPlatformOption'] = () => 'linux';
|
||||
// Override extension for linux default arch case to match util behavior
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/?os=linux_glibc&archive_type=tar.gz&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=${distroArch}&release_status=ga&availability_types=ca&page=1&page_size=100`;
|
||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?os=linux&ext=tar.gz&bundle_type=jdk&javafx=false&arch=${distroArch.arch}&hw_bitness=${distroArch.bitness}&release_status=ga`;
|
||||
|
||||
await distribution['getAvailableVersions']();
|
||||
|
||||
@ -203,18 +155,6 @@ describe('getAvailableVersions', () => {
|
||||
);
|
||||
|
||||
it('load available versions', async () => {
|
||||
spyHttpClient
|
||||
.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData as IZuluVersions[]
|
||||
})
|
||||
.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: [] as IZuluVersions[]
|
||||
});
|
||||
|
||||
const distribution = new ZuluDistribution({
|
||||
version: '11',
|
||||
architecture: 'x86',
|
||||
@ -228,11 +168,10 @@ describe('getAvailableVersions', () => {
|
||||
|
||||
describe('getArchitectureOptions', () => {
|
||||
it.each([
|
||||
[{architecture: 'x64'}, 'x64'],
|
||||
[{architecture: 'x86'}, 'i686'],
|
||||
[{architecture: 'aarch64'}, 'aarch64'],
|
||||
[{architecture: 'arm64'}, 'aarch64'],
|
||||
[{architecture: 'arm'}, 'arm']
|
||||
[{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
|
||||
[{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
|
||||
[{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
|
||||
[{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
|
||||
])('%s -> %s', (input, expected) => {
|
||||
const distribution = new ZuluDistribution({
|
||||
version: '11',
|
||||
@ -240,7 +179,7 @@ describe('getArchitectureOptions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
expect(distribution['getArchitectureOptions']()).toBe(expected);
|
||||
expect(distribution['getArchitectureOptions']()).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,76 +1,34 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import type {IZuluVersions} from '../../src/distributions/zulu/models.js';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
import * as semver from 'semver';
|
||||
import {ZuluDistribution} from '../../src/distributions/zulu/installer';
|
||||
import {IZuluVersions} from '../../src/distributions/zulu/models';
|
||||
import * as utils from '../../src/util';
|
||||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import manifestData from '../data/zulu-windows.json' with {type: 'json'};
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const real_util_module = await import('../../src/util.js');
|
||||
jest.unstable_mockModule('../../src/util.js', () => ({
|
||||
...real_util_module,
|
||||
getDownloadArchiveExtension: jest.fn()
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const {ZuluDistribution} =
|
||||
await import('../../src/distributions/zulu/installer.js');
|
||||
const utils = await import('../../src/util.js');
|
||||
import manifestData from '../data/zulu-windows.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: any;
|
||||
let spyCoreError: any;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
||||
let spyCoreError: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockReturnValue({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: [] as IZuluVersions[]
|
||||
result: manifestData as IZuluVersions[]
|
||||
});
|
||||
|
||||
(utils.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||
'zip'
|
||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
||||
utils,
|
||||
'getDownloadArchiveExtension'
|
||||
);
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
|
||||
|
||||
// Mock core.error to suppress error logs
|
||||
spyCoreError = core.error as jest.Mock;
|
||||
spyCoreError = jest.spyOn(core, 'error');
|
||||
spyCoreError.mockImplementation(() => {});
|
||||
});
|
||||
|
||||
@ -88,7 +46,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -97,7 +55,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=i686&release_status=ea&availability_types=ca&page=1&page_size=100'
|
||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -106,7 +64,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -115,7 +73,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jre',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jre&javafx_bundled=false&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=windows&ext=zip&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -124,7 +82,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk+fx',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -133,16 +91,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jre+fx',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jre&javafx_bundled=true&crac_supported=false&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
],
|
||||
[
|
||||
{
|
||||
version: '8',
|
||||
architecture: 'x64',
|
||||
packageType: 'jdk+crac',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=true&arch=x64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=windows&ext=zip&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -151,7 +100,7 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=aarch64&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
|
||||
],
|
||||
[
|
||||
{
|
||||
@ -160,12 +109,12 @@ describe('getAvailableVersions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
},
|
||||
'?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=arm&release_status=ga&availability_types=ca&page=1&page_size=100'
|
||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
|
||||
]
|
||||
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
||||
const distribution = new ZuluDistribution(input);
|
||||
distribution['getPlatformOption'] = () => 'windows';
|
||||
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
|
||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
|
||||
|
||||
await distribution['getAvailableVersions']();
|
||||
|
||||
@ -173,12 +122,16 @@ describe('getAvailableVersions', () => {
|
||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||
});
|
||||
|
||||
type DistroArch = {
|
||||
bitness: string;
|
||||
arch: string;
|
||||
};
|
||||
it.each([
|
||||
['amd64', 'x64'],
|
||||
['arm64', 'aarch64']
|
||||
['amd64', {bitness: '64', arch: 'x86'}],
|
||||
['arm64', {bitness: '64', arch: 'arm'}]
|
||||
])(
|
||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||
async (osArch: string, distroArch: string) => {
|
||||
async (osArch: string, distroArch: DistroArch) => {
|
||||
jest
|
||||
.spyOn(os, 'arch')
|
||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||
@ -190,7 +143,7 @@ describe('getAvailableVersions', () => {
|
||||
checkLatest: false
|
||||
});
|
||||
distribution['getPlatformOption'] = () => 'windows';
|
||||
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/?os=windows&archive_type=zip&java_package_type=jdk&javafx_bundled=false&crac_supported=false&arch=${distroArch}&release_status=ga&availability_types=ca&page=1&page_size=100`;
|
||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=${distroArch.arch}&hw_bitness=${distroArch.bitness}&release_status=ga`;
|
||||
|
||||
await distribution['getAvailableVersions']();
|
||||
|
||||
@ -200,18 +153,6 @@ describe('getAvailableVersions', () => {
|
||||
);
|
||||
|
||||
it('load available versions', async () => {
|
||||
spyHttpClient
|
||||
.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData as IZuluVersions[]
|
||||
})
|
||||
.mockReturnValueOnce({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: [] as IZuluVersions[]
|
||||
});
|
||||
|
||||
const distribution = new ZuluDistribution({
|
||||
version: '11',
|
||||
architecture: 'x86',
|
||||
@ -225,11 +166,10 @@ describe('getAvailableVersions', () => {
|
||||
|
||||
describe('getArchitectureOptions', () => {
|
||||
it.each([
|
||||
[{architecture: 'x64'}, 'x64'],
|
||||
[{architecture: 'x86'}, 'i686'],
|
||||
[{architecture: 'aarch64'}, 'aarch64'],
|
||||
[{architecture: 'arm64'}, 'aarch64'],
|
||||
[{architecture: 'arm'}, 'arm']
|
||||
[{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
|
||||
[{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
|
||||
[{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
|
||||
[{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
|
||||
])('%s -> %s', (input, expected) => {
|
||||
const distribution = new ZuluDistribution({
|
||||
version: '11',
|
||||
@ -237,7 +177,7 @@ describe('getArchitectureOptions', () => {
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
expect(distribution['getArchitectureOptions']()).toBe(expected);
|
||||
expect(distribution['getArchitectureOptions']()).toEqual(expected);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -1,29 +1,20 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterAll,
|
||||
afterEach
|
||||
} from '@jest/globals';
|
||||
import {fileURLToPath} from 'url';
|
||||
import * as path from 'path';
|
||||
import * as io from '@actions/io';
|
||||
import * as exec from '@actions/exec';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as gpg from '../src/gpg';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
jest.mock('@actions/exec', () => {
|
||||
return {
|
||||
exec: jest.fn()
|
||||
};
|
||||
});
|
||||
|
||||
jest.unstable_mockModule('@actions/exec', () => ({
|
||||
exec: jest.fn()
|
||||
}));
|
||||
|
||||
jest.unstable_mockModule('@actions/tool-cache', () => ({
|
||||
downloadTool: jest.fn()
|
||||
}));
|
||||
|
||||
const exec = await import('@actions/exec');
|
||||
const tc = await import('@actions/tool-cache');
|
||||
const gpg = await import('../src/gpg.js');
|
||||
jest.mock('@actions/tool-cache', () => {
|
||||
return {
|
||||
downloadTool: jest.fn()
|
||||
};
|
||||
});
|
||||
|
||||
const tempDir = path.join(__dirname, 'runner', 'temp');
|
||||
process.env['RUNNER_TEMP'] = tempDir;
|
||||
@ -101,9 +92,7 @@ describe('gpg tests', () => {
|
||||
it('imports bundled key and verifies package', async () => {
|
||||
const publicKeyContent =
|
||||
'-----BEGIN PGP PUBLIC KEY BLOCK-----\ntest\n-----END PGP PUBLIC KEY BLOCK-----';
|
||||
(tc.downloadTool as jest.Mock<any>).mockResolvedValue(
|
||||
'/tmp/jdk.tar.gz.sig'
|
||||
);
|
||||
(tc.downloadTool as jest.Mock).mockResolvedValue('/tmp/jdk.tar.gz.sig');
|
||||
await gpg.verifyPackageSignature(
|
||||
'/tmp/jdk.tar.gz',
|
||||
'https://example.com/jdk.tar.gz.sig',
|
||||
|
||||
@ -1,68 +1,42 @@
|
||||
import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
const mockGetInput = jest.fn<(...args: any[]) => any>();
|
||||
const mockExportVariable = jest.fn<(...args: any[]) => any>();
|
||||
const mockInfo = jest.fn<(...args: any[]) => any>();
|
||||
const mockDebug = jest.fn<(...args: any[]) => any>();
|
||||
const mockWarning = jest.fn<(...args: any[]) => any>();
|
||||
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
getInput: mockGetInput,
|
||||
exportVariable: mockExportVariable,
|
||||
info: mockInfo,
|
||||
debug: mockDebug,
|
||||
warning: mockWarning,
|
||||
setSecret: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn(),
|
||||
isDebug: jest.fn(),
|
||||
setCommandEcho: jest.fn(),
|
||||
getIDToken: jest.fn(),
|
||||
ExitCode: {Success: 0, Failure: 1},
|
||||
summary: {},
|
||||
markdownSummary: {},
|
||||
platform: {},
|
||||
toPosixPath: jest.fn(),
|
||||
toWin32Path: jest.fn(),
|
||||
toPlatformPath: jest.fn()
|
||||
}));
|
||||
|
||||
const {configureMavenArgs} = await import('../src/maven-args.js');
|
||||
const {
|
||||
import {configureMavenArgs} from '../src/maven-args';
|
||||
import {
|
||||
INPUT_SHOW_DOWNLOAD_PROGRESS,
|
||||
MAVEN_ARGS_ENV,
|
||||
MAVEN_NO_TRANSFER_PROGRESS_FLAG
|
||||
} = await import('../src/constants.js');
|
||||
} from '../src/constants';
|
||||
|
||||
describe('configureMavenArgs', () => {
|
||||
let inputs: Record<string, string>;
|
||||
let spyGetInput: jest.SpyInstance;
|
||||
let spyExportVariable: jest.SpyInstance;
|
||||
let spyInfo: jest.SpyInstance;
|
||||
let spyDebug: jest.SpyInstance;
|
||||
const originalMavenArgs = process.env[MAVEN_ARGS_ENV];
|
||||
|
||||
beforeEach(() => {
|
||||
inputs = {};
|
||||
|
||||
mockGetInput.mockImplementation((name: string) => inputs[name] ?? '');
|
||||
mockExportVariable.mockImplementation((name: string, value: string) => {
|
||||
spyGetInput = jest.spyOn(core, 'getInput');
|
||||
spyGetInput.mockImplementation((name: string) => inputs[name] ?? '');
|
||||
|
||||
spyExportVariable = jest.spyOn(core, 'exportVariable');
|
||||
spyExportVariable.mockImplementation((name: string, value: string) => {
|
||||
process.env[name] = value;
|
||||
});
|
||||
mockInfo.mockImplementation(() => undefined);
|
||||
mockDebug.mockImplementation(() => undefined);
|
||||
|
||||
spyInfo = jest.spyOn(core, 'info');
|
||||
spyInfo.mockImplementation(() => undefined);
|
||||
|
||||
spyDebug = jest.spyOn(core, 'debug');
|
||||
spyDebug.mockImplementation(() => undefined);
|
||||
|
||||
delete process.env[MAVEN_ARGS_ENV];
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
if (originalMavenArgs === undefined) {
|
||||
delete process.env[MAVEN_ARGS_ENV];
|
||||
} else {
|
||||
@ -73,7 +47,7 @@ describe('configureMavenArgs', () => {
|
||||
it('sets MAVEN_ARGS with -ntp by default', () => {
|
||||
configureMavenArgs();
|
||||
|
||||
expect(mockExportVariable).toHaveBeenCalledWith(
|
||||
expect(spyExportVariable).toHaveBeenCalledWith(
|
||||
MAVEN_ARGS_ENV,
|
||||
MAVEN_NO_TRANSFER_PROGRESS_FLAG
|
||||
);
|
||||
@ -85,7 +59,7 @@ describe('configureMavenArgs', () => {
|
||||
|
||||
configureMavenArgs();
|
||||
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
expect(spyExportVariable).not.toHaveBeenCalled();
|
||||
expect(process.env[MAVEN_ARGS_ENV]).toBeUndefined();
|
||||
});
|
||||
|
||||
@ -94,7 +68,7 @@ describe('configureMavenArgs', () => {
|
||||
|
||||
configureMavenArgs();
|
||||
|
||||
expect(mockExportVariable).toHaveBeenCalledWith(
|
||||
expect(spyExportVariable).toHaveBeenCalledWith(
|
||||
MAVEN_ARGS_ENV,
|
||||
`-B -Dstyle.color=always ${MAVEN_NO_TRANSFER_PROGRESS_FLAG}`
|
||||
);
|
||||
@ -105,7 +79,7 @@ describe('configureMavenArgs', () => {
|
||||
|
||||
configureMavenArgs();
|
||||
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
expect(spyExportVariable).not.toHaveBeenCalled();
|
||||
expect(process.env[MAVEN_ARGS_ENV]).toBe('-B -ntp');
|
||||
});
|
||||
|
||||
@ -114,7 +88,7 @@ describe('configureMavenArgs', () => {
|
||||
|
||||
configureMavenArgs();
|
||||
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
expect(spyExportVariable).not.toHaveBeenCalled();
|
||||
expect(process.env[MAVEN_ARGS_ENV]).toBe('--no-transfer-progress -B');
|
||||
});
|
||||
|
||||
@ -124,7 +98,7 @@ describe('configureMavenArgs', () => {
|
||||
|
||||
configureMavenArgs();
|
||||
|
||||
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||
expect(spyExportVariable).not.toHaveBeenCalled();
|
||||
expect(process.env[MAVEN_ARGS_ENV]).toBe('-B');
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,63 +1,23 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterEach,
|
||||
beforeAll,
|
||||
afterAll
|
||||
} from '@jest/globals';
|
||||
import {fileURLToPath} from 'url';
|
||||
import * as fs from 'fs';
|
||||
import os from 'os';
|
||||
import * as path from 'path';
|
||||
import * as core from '@actions/core';
|
||||
import * as io from '@actions/io';
|
||||
import * as toolchains from '../src/toolchains';
|
||||
import {M2_DIR, MVN_TOOLCHAINS_FILE} from '../src/constants';
|
||||
|
||||
// Mock @actions/core before importing source modules that depend on it
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
info: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
// Dynamic imports after mocking
|
||||
const core = await import('@actions/core');
|
||||
const toolchains = await import('../src/toolchains.js');
|
||||
const {M2_DIR, MVN_TOOLCHAINS_FILE} = await import('../src/constants.js');
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const m2Dir = path.join(__dirname, M2_DIR);
|
||||
const toolchainsFile = path.join(m2Dir, MVN_TOOLCHAINS_FILE);
|
||||
|
||||
describe('toolchains tests', () => {
|
||||
let spyOSHomedir: any;
|
||||
let spyInfo: any;
|
||||
let spyOSHomedir: jest.SpyInstance;
|
||||
let spyInfo: jest.SpyInstance;
|
||||
|
||||
beforeEach(async () => {
|
||||
await io.rmRF(m2Dir);
|
||||
spyOSHomedir = jest.spyOn(os, 'homedir');
|
||||
spyOSHomedir.mockReturnValue(__dirname);
|
||||
spyInfo = core.info as jest.Mock;
|
||||
spyInfo = jest.spyOn(core, 'info');
|
||||
spyInfo.mockImplementation(() => null);
|
||||
}, 300000);
|
||||
|
||||
@ -935,11 +895,6 @@ describe('toolchains tests', () => {
|
||||
const jdkHome =
|
||||
'/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64';
|
||||
|
||||
(core.getInput as jest.Mock<any>).mockImplementation((name: string) => {
|
||||
if (name === 'settings-path') return m2Dir;
|
||||
return '';
|
||||
});
|
||||
|
||||
await toolchains.configureToolchains(
|
||||
version,
|
||||
distributionName,
|
||||
|
||||
@ -1,55 +1,8 @@
|
||||
import {
|
||||
jest,
|
||||
describe,
|
||||
it,
|
||||
expect,
|
||||
beforeEach,
|
||||
afterAll,
|
||||
afterEach
|
||||
} from '@jest/globals';
|
||||
import {fileURLToPath} from 'url';
|
||||
import * as cache from '@actions/cache';
|
||||
import * as core from '@actions/core';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
// Mock @actions/cache
|
||||
jest.unstable_mockModule('@actions/cache', () => ({
|
||||
isFeatureAvailable: jest.fn(),
|
||||
saveCache: jest.fn(),
|
||||
restoreCache: jest.fn()
|
||||
}));
|
||||
|
||||
// Mock @actions/core
|
||||
jest.unstable_mockModule('@actions/core', () => ({
|
||||
getInput: jest.fn(),
|
||||
getBooleanInput: jest.fn(),
|
||||
getMultilineInput: jest.fn(),
|
||||
setOutput: jest.fn(),
|
||||
setFailed: jest.fn(),
|
||||
warning: jest.fn(),
|
||||
info: jest.fn(),
|
||||
debug: jest.fn(),
|
||||
error: jest.fn(),
|
||||
notice: jest.fn(),
|
||||
startGroup: jest.fn(),
|
||||
endGroup: jest.fn(),
|
||||
addPath: jest.fn(),
|
||||
exportVariable: jest.fn(),
|
||||
saveState: jest.fn(),
|
||||
getState: jest.fn(),
|
||||
setSecret: jest.fn(),
|
||||
isDebug: jest.fn(() => false),
|
||||
group: jest.fn((_name: string, fn: () => Promise<unknown>) => fn()),
|
||||
toPlatformPath: jest.fn((p: string) => p),
|
||||
toWin32Path: jest.fn((p: string) => p),
|
||||
toPosixPath: jest.fn((p: string) => p)
|
||||
}));
|
||||
|
||||
const cache = await import('@actions/cache');
|
||||
const core = await import('@actions/core');
|
||||
|
||||
const {
|
||||
import {
|
||||
convertVersionToSemver,
|
||||
getNextPageUrlFromLinkHeader,
|
||||
getVersionFromFileContent,
|
||||
@ -57,7 +10,10 @@ const {
|
||||
isCacheFeatureAvailable,
|
||||
isGhes,
|
||||
validatePaginationUrl
|
||||
} = await import('../src/util.js');
|
||||
} from '../src/util';
|
||||
|
||||
jest.mock('@actions/cache');
|
||||
jest.mock('@actions/core');
|
||||
|
||||
describe('isVersionSatisfies', () => {
|
||||
it.each([
|
||||
@ -89,10 +45,8 @@ describe('isVersionSatisfies', () => {
|
||||
|
||||
describe('isCacheFeatureAvailable', () => {
|
||||
it('isCacheFeatureAvailable disabled on GHES', () => {
|
||||
(cache.isFeatureAvailable as jest.Mock<any>).mockImplementation(
|
||||
() => false
|
||||
);
|
||||
const infoMock = core.warning as jest.Mock;
|
||||
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
|
||||
const infoMock = jest.spyOn(core, 'warning');
|
||||
const message =
|
||||
'Caching is only supported on GHES version >= 3.5. If you are on a version >= 3.5, please check with your GHES admin if the Actions cache service is enabled or not.';
|
||||
try {
|
||||
@ -105,10 +59,8 @@ describe('isCacheFeatureAvailable', () => {
|
||||
});
|
||||
|
||||
it('isCacheFeatureAvailable disabled on dotcom', () => {
|
||||
(cache.isFeatureAvailable as jest.Mock<any>).mockImplementation(
|
||||
() => false
|
||||
);
|
||||
const infoMock = core.warning as jest.Mock;
|
||||
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
|
||||
const infoMock = jest.spyOn(core, 'warning');
|
||||
const message =
|
||||
'The runner was not able to contact the cache service. Caching will be skipped';
|
||||
try {
|
||||
@ -121,14 +73,9 @@ describe('isCacheFeatureAvailable', () => {
|
||||
});
|
||||
|
||||
it('isCacheFeatureAvailable is enabled', () => {
|
||||
(cache.isFeatureAvailable as jest.Mock<any>).mockImplementation(() => true);
|
||||
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => true);
|
||||
expect(isCacheFeatureAvailable()).toBe(true);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
});
|
||||
|
||||
describe('convertVersionToSemver', () => {
|
||||
@ -296,78 +243,13 @@ describe('getVersionFromFileContent', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('.tool-versions', () => {
|
||||
it.each([
|
||||
['java temurin-17.0.3+7', '17.0.3+7', 'temurin'],
|
||||
['java temurin-jre-17.0.3+7', '17.0.3+7', 'temurin'],
|
||||
['java adoptopenjdk-11.0.16+8', '11.0.16+8', 'temurin'],
|
||||
['java adoptopenjdk-openj9-11.0.16+8', '11.0.16+8', 'temurin'],
|
||||
['java zulu-11.56.19', '11.56.19', 'zulu'],
|
||||
['java corretto-17.0.13.11.1', '17', 'corretto'], // corretto -> major only
|
||||
['java liberica-11.0.15+10', '11.0.15+10', 'liberica'],
|
||||
['java microsoft-11.0.13.8.1', '11.0.13', 'microsoft'],
|
||||
['java semeru-openj9-11.0.25+9', '11.0.25+9', 'semeru'],
|
||||
['java ibm-openj9-11.0.25+9', '11.0.25+9', 'semeru'],
|
||||
['java dragonwell-17.0.13.0.13+11', '17.0.13', 'dragonwell'],
|
||||
['java graalvm-22.3.0+java17', '22.3.0+java17', 'graalvm'],
|
||||
['java graalvm-community-22.3.0', '22.3.0', 'graalvm-community'],
|
||||
['java oracle-graalvm-21.0.5', '21.0.5', 'graalvm'],
|
||||
['java oracle-21.0.5', '21.0.5', 'oracle'],
|
||||
['java sapmachine-21.0.5', '21.0.5', 'sapmachine'],
|
||||
['java kona-17.0.13', '17.0.13', 'kona'],
|
||||
['java jetbrains-21.0.5', '21.0.5', 'jetbrains']
|
||||
])(
|
||||
'parsing %s should return version %s and distribution %s',
|
||||
(content: string, expectedVersion: string, expectedDist: string) => {
|
||||
const actual = getVersionFromFileContent(
|
||||
content,
|
||||
'openjdk',
|
||||
'.tool-versions'
|
||||
);
|
||||
expect(actual?.version).toBe(expectedVersion);
|
||||
expect(actual?.distribution).toBe(expectedDist);
|
||||
}
|
||||
);
|
||||
|
||||
it.each([
|
||||
['java 17.0.7', '17.0.7'],
|
||||
['java 17', '17'],
|
||||
['java 1.8', '8'],
|
||||
['java 21-ea', '21-ea']
|
||||
])(
|
||||
'parsing prefix-less %s should return version %s and no distribution',
|
||||
(content: string, expectedVersion: string) => {
|
||||
const actual = getVersionFromFileContent(
|
||||
content,
|
||||
'temurin',
|
||||
'.tool-versions'
|
||||
);
|
||||
expect(actual?.version).toBe(expectedVersion);
|
||||
expect(actual?.distribution).toBeUndefined();
|
||||
}
|
||||
);
|
||||
|
||||
it('should warn and return undefined distribution for unsupported vendor', () => {
|
||||
const warnSpy = jest.spyOn(core, 'warning');
|
||||
const actual = getVersionFromFileContent(
|
||||
'java openjdk-17.0.7',
|
||||
'temurin',
|
||||
'.tool-versions'
|
||||
);
|
||||
expect(actual?.version).toBe('17.0.7');
|
||||
expect(actual?.distribution).toBeUndefined();
|
||||
expect(warnSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining('Unknown asdf distribution identifier')
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('isGhes', () => {
|
||||
const pristineEnv = process.env;
|
||||
|
||||
beforeEach(() => {
|
||||
jest.resetModules();
|
||||
process.env = {...pristineEnv};
|
||||
});
|
||||
|
||||
|
||||
@ -13,19 +13,15 @@ inputs:
|
||||
description: 'Java distribution. See the list of supported distributions in README file. This input is required except when java-version-file points to .sdkmanrc with a recognized distribution suffix (e.g., java=21.0.5-tem).'
|
||||
required: false
|
||||
java-package:
|
||||
description: 'The package type (jdk, jre, jdk+fx, jre+fx, jdk+crac, jre+crac)'
|
||||
description: 'The package type (jdk, jre, jdk+fx, jre+fx)'
|
||||
required: false
|
||||
default: 'jdk'
|
||||
architecture:
|
||||
description: "The architecture of the package (defaults to the action runner's architecture)"
|
||||
required: false
|
||||
jdk-file:
|
||||
jdkFile:
|
||||
description: 'Path to where the compressed JDK is located'
|
||||
required: false
|
||||
jdkFile:
|
||||
description: 'Deprecated alias for `jdk-file`. Path to where the compressed JDK is located. Use `jdk-file` instead; this alias may be removed in a future release.'
|
||||
required: false
|
||||
deprecationMessage: 'The `jdkFile` input is deprecated. Use `jdk-file` instead.'
|
||||
check-latest:
|
||||
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec'
|
||||
required: false
|
||||
|
||||
118333
dist/cleanup/index.js
vendored
118333
dist/cleanup/index.js
vendored
File diff suppressed because one or more lines are too long
3
dist/cleanup/package.json
vendored
3
dist/cleanup/package.json
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
136034
dist/setup/index.js
vendored
136034
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
3
dist/setup/package.json
vendored
3
dist/setup/package.json
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
@ -41,7 +41,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@ -66,8 +66,8 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '25'
|
||||
java-package: jdk # optional (jdk, jre, jdk+fx, jre+fx, jdk+crac, or jre+crac) - defaults to jdk
|
||||
java-version: '21'
|
||||
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@ -79,7 +79,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
|
||||
- run: java --version
|
||||
```
|
||||
@ -92,7 +92,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'microsoft'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@ -107,7 +107,7 @@ uses: actions/setup-java@v5
|
||||
with:
|
||||
token: ${{ secrets.GH_DOTCOM_TOKEN }}
|
||||
distribution: 'microsoft'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
```
|
||||
|
||||
If the runner is not able to access github.com, any Java versions requested during a workflow run must come from the runner's tool cache. See "[Setting up the tool cache on self-hosted runners without internet access](https://docs.github.com/en/enterprise-server@3.2/admin/github-actions/managing-access-to-actions-from-githubcom/setting-up-the-tool-cache-on-self-hosted-runners-without-internet-access)" for more information.
|
||||
@ -121,7 +121,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'corretto'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@ -134,7 +134,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'oracle'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@ -159,7 +159,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'sapmachine'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
- run: java --version
|
||||
```
|
||||
|
||||
@ -172,7 +172,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'graalvm'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
- run: |
|
||||
java --version
|
||||
native-image --version
|
||||
@ -256,7 +256,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: '<distribution>'
|
||||
java-version: '25'
|
||||
java-version: '11'
|
||||
java-package: jdk # optional (jdk or jre) - defaults to jdk
|
||||
- run: java --version
|
||||
```
|
||||
@ -271,7 +271,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'zulu'
|
||||
java-version: '25'
|
||||
java-version: '21'
|
||||
java-package: jdk+fx
|
||||
cache: maven
|
||||
- name: Build with Maven
|
||||
@ -293,7 +293,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: '<distribution>'
|
||||
java-version: '25'
|
||||
java-version: '11'
|
||||
architecture: x86 # optional - default value derived from the runner machine
|
||||
- run: java --version
|
||||
```
|
||||
@ -330,7 +330,7 @@ In this example, `JAVA_HOME` and `java` on `PATH` point to Java 17, while Java 2
|
||||
If your use-case requires a custom distribution or a version that is not provided by setup-java, you can download it manually and setup-java will take care of the installation and caching on the VM:
|
||||
|
||||
> [!NOTE]
|
||||
> This approach also lets you use builds that setup-java does not provide directly, such as **Early Access (EA)** or other unreleased JDK builds (for example, an upcoming feature release or a Loom/Valhalla preview build). Download the desired archive in a prior step and point `jdk-file` at it; setup-java will extract, install, and cache it just like a supported distribution. When targeting multiple architectures, select the correct binary per architecture in your workflow (for example, with a build matrix).
|
||||
> This approach also lets you use builds that setup-java does not provide directly, such as **Early Access (EA)** or other unreleased JDK builds (for example, an upcoming feature release or a Loom/Valhalla preview build). Download the desired archive in a prior step and point `jdkFile` at it; setup-java will extract, install, and cache it just like a supported distribution. When targeting multiple architectures, select the correct binary per architecture in your workflow (for example, with a build matrix).
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
@ -340,7 +340,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
||||
java-version: '11.0.0'
|
||||
architecture: x64
|
||||
|
||||
@ -357,7 +357,7 @@ steps:
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
||||
java-version: '25.0.0-ea.36'
|
||||
architecture: x64
|
||||
|
||||
@ -383,7 +383,7 @@ If your use-case requires a custom distribution (in the example, alpine-linux is
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
||||
java-version: {{ steps.fetch_latest_jdk.outputs.java_version }}
|
||||
architecture: x64
|
||||
- run: java --version
|
||||
@ -708,7 +708,7 @@ The result is a Toolchain with entries for JDKs 8, 11 and 15. You can even combi
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
||||
java-version: '1.6'
|
||||
architecture: x64
|
||||
```
|
||||
@ -725,7 +725,7 @@ Each JDK provider will receive a default `vendor` using the `distribution` input
|
||||
- uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
||||
java-version: '1.6'
|
||||
architecture: x64
|
||||
mvn-toolchain-vendor: 'Oracle'
|
||||
@ -780,27 +780,7 @@ steps:
|
||||
|
||||
Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
|
||||
* In `.java-version` file, only the version should be specified (e.g., 17.0.7). The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv).
|
||||
* In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)). When the entry includes an [asdf-java](https://github.com/halcyon/asdf-java) vendor prefix (e.g. `java temurin-17.0.3+7`), setup-java can infer the `distribution` input automatically. Unrecognized vendor prefixes require setting `distribution` explicitly.
|
||||
|
||||
Supported asdf-java vendor prefix mappings (packaging variants such as `-jre`, `-musl`, `-openj9`, `-crac`, `-javafx` are collapsed onto the base vendor):
|
||||
|
||||
| asdf-java vendor prefix | setup-java distribution |
|
||||
| ----------------------- | ----------------------- |
|
||||
| `temurin` | `temurin` |
|
||||
| `adoptopenjdk` | `temurin` |
|
||||
| `zulu` | `zulu` |
|
||||
| `corretto` | `corretto` |
|
||||
| `liberica` | `liberica` |
|
||||
| `microsoft` | `microsoft` |
|
||||
| `semeru`, `ibm` | `semeru` |
|
||||
| `dragonwell` | `dragonwell` |
|
||||
| `graalvm`, `oracle-graalvm` | `graalvm` |
|
||||
| `graalvm-community` | `graalvm-community` |
|
||||
| `oracle` | `oracle` |
|
||||
| `sapmachine` | `sapmachine` |
|
||||
| `kona` | `kona` |
|
||||
| `jetbrains` | `jetbrains` |
|
||||
|
||||
* In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
|
||||
* In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., `java=17.0.7-tem`). When a recognized SDKMAN distribution suffix is present, setup-java can infer the `distribution` input automatically. Unrecognized suffixes require setting `distribution` explicitly. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information.
|
||||
|
||||
Supported SDKMAN suffix mappings:
|
||||
@ -836,19 +816,6 @@ steps:
|
||||
java=17.0.7-tem
|
||||
```
|
||||
|
||||
**Example step using `asdf`** (distribution inferred from `.tool-versions`):
|
||||
```yml
|
||||
- name: Setup java
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
java-version-file: '.tool-versions'
|
||||
```
|
||||
|
||||
**Example `.tool-versions`**:
|
||||
```
|
||||
java temurin-17.0.7+7
|
||||
```
|
||||
|
||||
Valid entry options (does not apply to `.sdkmanrc`):
|
||||
```
|
||||
major versions: 8, 11, 16, 17, 21
|
||||
|
||||
@ -1,74 +0,0 @@
|
||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
||||
import js from '@eslint/js';
|
||||
import tsParser from '@typescript-eslint/parser';
|
||||
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
||||
import jest from 'eslint-plugin-jest';
|
||||
import n from 'eslint-plugin-n';
|
||||
import prettier from 'eslint-config-prettier';
|
||||
import globals from 'globals';
|
||||
|
||||
export default [
|
||||
{
|
||||
ignores: ['**/*', '!src/**', '!__tests__/**']
|
||||
},
|
||||
js.configs.recommended,
|
||||
{
|
||||
files: ['**/*.ts'],
|
||||
languageOptions: {
|
||||
parser: tsParser,
|
||||
ecmaVersion: 2022,
|
||||
sourceType: 'module',
|
||||
globals: {
|
||||
...globals.node,
|
||||
...globals.es2015
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
'@typescript-eslint': tsPlugin,
|
||||
n
|
||||
},
|
||||
rules: {
|
||||
...tsPlugin.configs.recommended.rules,
|
||||
'@typescript-eslint/no-require-imports': 'error',
|
||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-empty-function': 'off',
|
||||
'@typescript-eslint/ban-ts-comment': [
|
||||
'error',
|
||||
{
|
||||
'ts-ignore': 'allow-with-description'
|
||||
}
|
||||
],
|
||||
'no-console': 'error',
|
||||
yoda: 'error',
|
||||
'prefer-const': [
|
||||
'error',
|
||||
{
|
||||
destructuring: 'all'
|
||||
}
|
||||
],
|
||||
'no-control-regex': 'off',
|
||||
'no-constant-condition': ['error', {checkLoops: false}],
|
||||
'no-undef': 'off',
|
||||
'no-useless-assignment': 'off',
|
||||
'n/no-extraneous-import': 'error'
|
||||
}
|
||||
},
|
||||
{
|
||||
files: ['**/*{test,spec}.ts'],
|
||||
plugins: {jest},
|
||||
languageOptions: {
|
||||
globals: {
|
||||
...globals.jest
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
...jest.configs['flat/recommended'].rules,
|
||||
'@typescript-eslint/no-unused-vars': 'off',
|
||||
'jest/no-standalone-expect': 'off',
|
||||
'jest/no-conditional-expect': 'off',
|
||||
'no-console': 'off'
|
||||
}
|
||||
},
|
||||
prettier
|
||||
];
|
||||
11
jest.config.js
Normal file
11
jest.config.js
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
testRunner: 'jest-circus/runner',
|
||||
transform: {
|
||||
'^.+\\.ts$': 'ts-jest'
|
||||
},
|
||||
verbose: true
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
export default {
|
||||
clearMocks: true,
|
||||
moduleFileExtensions: ['js', 'ts'],
|
||||
roots: ['<rootDir>'],
|
||||
testEnvironment: 'node',
|
||||
testMatch: ['**/*.test.ts'],
|
||||
transform: {
|
||||
'^.+\\.ts$': [
|
||||
'ts-jest',
|
||||
{
|
||||
useESM: true,
|
||||
diagnostics: {
|
||||
ignoreCodes: [151002]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
extensionsToTreatAsEsm: ['.ts'],
|
||||
transformIgnorePatterns: ['node_modules/(?!(@actions)/)'],
|
||||
moduleNameMapper: {
|
||||
'^(\\.{1,2}/.*)\\.js$': '$1'
|
||||
},
|
||||
verbose: true
|
||||
}
|
||||
3071
package-lock.json
generated
3071
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
50
package.json
50
package.json
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "setup-java",
|
||||
"version": "6.0.0",
|
||||
"type": "module",
|
||||
"version": "5.3.0",
|
||||
"private": true,
|
||||
"description": "setup java action",
|
||||
"main": "dist/setup/index.js",
|
||||
@ -10,24 +9,24 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts",
|
||||
"format": "prettier --no-error-on-unmatched-pattern --write \"**/*.{ts,yml,yaml}\"",
|
||||
"format-check": "prettier --no-error-on-unmatched-pattern --check \"**/*.{ts,yml,yaml}\"",
|
||||
"lint": "eslint \"**/*.ts\"",
|
||||
"lint:fix": "eslint \"**/*.ts\" --fix",
|
||||
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
|
||||
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check \"**/*.{ts,yml,yaml}\"",
|
||||
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
|
||||
"lint:fix": "eslint --config ./.eslintrc.js \"**/*.ts\" --fix",
|
||||
"check": "npm run format-check && npm run lint && npm run build && npm test",
|
||||
"fix": "npm run format && npm run lint:fix && npm run build",
|
||||
"prepare": "husky install",
|
||||
"prerelease": "npm run-script build",
|
||||
"release": "git add -f dist/setup/index.js dist/cleanup/index.js",
|
||||
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand --coverage"
|
||||
"test": "jest"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.ts": [
|
||||
"prettier --no-error-on-unmatched-pattern --write",
|
||||
"eslint --fix"
|
||||
"prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write",
|
||||
"eslint --config ./.eslintrc.js --fix"
|
||||
],
|
||||
"*.{yml,yaml}": [
|
||||
"prettier --no-error-on-unmatched-pattern --write"
|
||||
"prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
@ -42,35 +41,34 @@
|
||||
"author": "GitHub",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^6.1.0",
|
||||
"@actions/core": "^3.0.1",
|
||||
"@actions/exec": "^3.0.0",
|
||||
"@actions/glob": "^0.7.0",
|
||||
"@actions/http-client": "^4.0.1",
|
||||
"@actions/io": "^3.0.2",
|
||||
"@actions/tool-cache": "^4.0.0",
|
||||
"semver": "^7.8.5",
|
||||
"@actions/cache": "^5.1.0",
|
||||
"@actions/core": "^2.0.3",
|
||||
"@actions/exec": "^2.0.0",
|
||||
"@actions/glob": "^0.5.1",
|
||||
"@actions/http-client": "^3.0.2",
|
||||
"@actions/io": "^2.0.0",
|
||||
"@actions/tool-cache": "^3.0.1",
|
||||
"semver": "^7.6.0",
|
||||
"xmlbuilder2": "^4.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@jest/globals": "^30.4.1",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^26.0.0",
|
||||
"@types/semver": "^7.7.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
||||
"@typescript-eslint/parser": "^8.62.0",
|
||||
"@vercel/ncc": "^0.44.0",
|
||||
"eslint": "^10.5.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-jest": "^29.15.4",
|
||||
"eslint-plugin-n": "^18.1.0",
|
||||
"globals": "^17.7.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"husky": "^9.1.7",
|
||||
"jest": "^30.4.2",
|
||||
"jest-circus": "^30.4.2",
|
||||
"lint-staged": "^17.0.8",
|
||||
"prettier": "^3.9.1",
|
||||
"ts-jest": "^29.4.11",
|
||||
"typescript": "^6.0.3"
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/actions/setup-java/issues"
|
||||
|
||||
@ -6,9 +6,9 @@ import * as fs from 'fs';
|
||||
import * as os from 'os';
|
||||
|
||||
import {create as xmlCreate} from 'xmlbuilder2';
|
||||
import * as constants from './constants.js';
|
||||
import * as gpg from './gpg.js';
|
||||
import {getBooleanInput} from './util.js';
|
||||
import * as constants from './constants';
|
||||
import * as gpg from './gpg';
|
||||
import {getBooleanInput} from './util';
|
||||
|
||||
export async function configureAuthentication() {
|
||||
const id = core.getInput(constants.INPUT_SERVER_ID);
|
||||
|
||||
@ -28,11 +28,7 @@ const supportedPackageManager: PackageManager[] = [
|
||||
join(os.homedir(), '.m2', 'wrapper', 'dists')
|
||||
],
|
||||
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
|
||||
pattern: [
|
||||
'**/pom.xml',
|
||||
'**/.mvn/wrapper/maven-wrapper.properties',
|
||||
'**/.mvn/extensions.xml'
|
||||
]
|
||||
pattern: ['**/pom.xml', '**/.mvn/wrapper/maven-wrapper.properties']
|
||||
},
|
||||
{
|
||||
id: 'gradle',
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import * as core from '@actions/core';
|
||||
import * as gpg from './gpg.js';
|
||||
import * as constants from './constants.js';
|
||||
import {isJobStatusSuccess} from './util.js';
|
||||
import {save} from './cache.js';
|
||||
import {fileURLToPath} from 'url';
|
||||
import * as gpg from './gpg';
|
||||
import * as constants from './constants';
|
||||
import {isJobStatusSuccess} from './util';
|
||||
import {save} from './cache';
|
||||
|
||||
async function removePrivateKeyFromKeychain() {
|
||||
if (core.getInput(constants.INPUT_GPG_PRIVATE_KEY, {required: false})) {
|
||||
@ -53,7 +52,7 @@ export async function run() {
|
||||
await ignoreError(saveCache());
|
||||
}
|
||||
|
||||
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
||||
if (require.main === module) {
|
||||
run();
|
||||
} else {
|
||||
// https://nodejs.org/api/modules.html#modules_accessing_the_main_module
|
||||
|
||||
@ -4,8 +4,7 @@ export const INPUT_JAVA_VERSION_FILE = 'java-version-file';
|
||||
export const INPUT_ARCHITECTURE = 'architecture';
|
||||
export const INPUT_JAVA_PACKAGE = 'java-package';
|
||||
export const INPUT_DISTRIBUTION = 'distribution';
|
||||
export const INPUT_JDK_FILE = 'jdk-file';
|
||||
export const INPUT_JDK_FILE_DEPRECATED = 'jdkFile';
|
||||
export const INPUT_JDK_FILE = 'jdkFile';
|
||||
export const INPUT_CHECK_LATEST = 'check-latest';
|
||||
export const INPUT_SET_DEFAULT = 'set-default';
|
||||
export const INPUT_VERIFY_SIGNATURE = 'verify-signature';
|
||||
|
||||
@ -5,13 +5,13 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import semver from 'semver';
|
||||
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {IAdoptAvailableVersions} from './models.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {IAdoptAvailableVersions} from './models';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getNextPageUrlFromLinkHeader,
|
||||
@ -20,11 +20,8 @@ import {
|
||||
renameWinArchive,
|
||||
MAX_PAGINATION_PAGES,
|
||||
validatePaginationUrl
|
||||
} from '../../util.js';
|
||||
import {
|
||||
TemurinDistribution,
|
||||
TemurinImplementation
|
||||
} from '../temurin/installer.js';
|
||||
} from '../../util';
|
||||
import {TemurinDistribution, TemurinImplementation} from '../temurin/installer';
|
||||
|
||||
export enum AdoptImplementation {
|
||||
Hotspot = 'Hotspot',
|
||||
|
||||
@ -4,13 +4,13 @@ import * as fs from 'fs';
|
||||
import semver from 'semver';
|
||||
import path from 'path';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import {getToolcachePath, isVersionSatisfies} from '../util.js';
|
||||
import {getToolcachePath, isVersionSatisfies} from '../util';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from './base-models.js';
|
||||
import {MACOS_JAVA_CONTENT_POSTFIX} from '../constants.js';
|
||||
} from './base-models';
|
||||
import {MACOS_JAVA_CONTENT_POSTFIX} from '../constants';
|
||||
import os from 'os';
|
||||
|
||||
export abstract class JavaBase {
|
||||
|
||||
@ -7,17 +7,17 @@ import {
|
||||
getDownloadArchiveExtension,
|
||||
convertVersionToSemver,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
} from '../../util';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import {
|
||||
ICorrettoAllAvailableVersions,
|
||||
ICorrettoAvailableVersions
|
||||
} from './models.js';
|
||||
} from './models';
|
||||
|
||||
export class CorrettoDistribution extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
|
||||
@ -1,25 +1,22 @@
|
||||
import {JavaBase} from './base-installer.js';
|
||||
import {JavaInstallerOptions} from './base-models.js';
|
||||
import {LocalDistribution} from './local/installer.js';
|
||||
import {ZuluDistribution} from './zulu/installer.js';
|
||||
import {AdoptDistribution, AdoptImplementation} from './adopt/installer.js';
|
||||
import {
|
||||
TemurinDistribution,
|
||||
TemurinImplementation
|
||||
} from './temurin/installer.js';
|
||||
import {LibericaDistributions} from './liberica/installer.js';
|
||||
import {MicrosoftDistributions} from './microsoft/installer.js';
|
||||
import {SemeruDistribution} from './semeru/installer.js';
|
||||
import {CorrettoDistribution} from './corretto/installer.js';
|
||||
import {OracleDistribution} from './oracle/installer.js';
|
||||
import {DragonwellDistribution} from './dragonwell/installer.js';
|
||||
import {SapMachineDistribution} from './sapmachine/installer.js';
|
||||
import {JavaBase} from './base-installer';
|
||||
import {JavaInstallerOptions} from './base-models';
|
||||
import {LocalDistribution} from './local/installer';
|
||||
import {ZuluDistribution} from './zulu/installer';
|
||||
import {AdoptDistribution, AdoptImplementation} from './adopt/installer';
|
||||
import {TemurinDistribution, TemurinImplementation} from './temurin/installer';
|
||||
import {LibericaDistributions} from './liberica/installer';
|
||||
import {MicrosoftDistributions} from './microsoft/installer';
|
||||
import {SemeruDistribution} from './semeru/installer';
|
||||
import {CorrettoDistribution} from './corretto/installer';
|
||||
import {OracleDistribution} from './oracle/installer';
|
||||
import {DragonwellDistribution} from './dragonwell/installer';
|
||||
import {SapMachineDistribution} from './sapmachine/installer';
|
||||
import {
|
||||
GraalVMCommunityDistribution,
|
||||
GraalVMDistribution
|
||||
} from './graalvm/installer.js';
|
||||
import {JetBrainsDistribution} from './jetbrains/installer.js';
|
||||
import {KonaDistribution} from './kona/installer.js';
|
||||
} from './graalvm/installer';
|
||||
import {JetBrainsDistribution} from './jetbrains/installer';
|
||||
import {KonaDistribution} from './kona/installer';
|
||||
|
||||
enum JavaDistribution {
|
||||
Adopt = 'adopt',
|
||||
|
||||
@ -5,7 +5,7 @@ import semver from 'semver';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
convertVersionToSemver,
|
||||
extractJdkFile,
|
||||
@ -13,13 +13,13 @@ import {
|
||||
getGitHubHttpHeaders,
|
||||
isVersionSatisfies,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
import {IDragonwellVersions, IDragonwellAllVersions} from './models.js';
|
||||
} from '../../util';
|
||||
import {IDragonwellVersions, IDragonwellAllVersions} from './models';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
|
||||
export class DragonwellDistribution extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
|
||||
@ -3,14 +3,14 @@ import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import semver from 'semver';
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {HttpCodes} from '@actions/http-client';
|
||||
import {GraalVMEAVersion} from './models.js';
|
||||
import {GraalVMEAVersion} from './models';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import {
|
||||
convertVersionToSemver,
|
||||
extractJdkFile,
|
||||
@ -21,7 +21,7 @@ import {
|
||||
MAX_PAGINATION_PAGES,
|
||||
renameWinArchive,
|
||||
validatePaginationUrl
|
||||
} from '../../util.js';
|
||||
} from '../../util';
|
||||
|
||||
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
|
||||
const GRAALVM_DOWNLOAD_URL = 'https://www.graalvm.org/downloads/';
|
||||
@ -300,20 +300,17 @@ export class GraalVMDistribution extends JavaBase {
|
||||
// Check if it's a 404 error (file not found)
|
||||
if (error.message?.includes('404')) {
|
||||
throw new Error(
|
||||
`GraalVM EA version '${javaEaVersion}' not found. Please verify the version exists in the EA builds repository.`,
|
||||
{cause: error}
|
||||
`GraalVM EA version '${javaEaVersion}' not found. Please verify the version exists in the EA builds repository.`
|
||||
);
|
||||
}
|
||||
// Re-throw with more context
|
||||
throw new Error(
|
||||
`Failed to fetch GraalVM EA version information for '${javaEaVersion}': ${error.message}`,
|
||||
{cause: error}
|
||||
`Failed to fetch GraalVM EA version information for '${javaEaVersion}': ${error.message}`
|
||||
);
|
||||
}
|
||||
// If it's not an Error instance, throw a generic error
|
||||
throw new Error(
|
||||
`Failed to fetch GraalVM EA version information for '${javaEaVersion}'`,
|
||||
{cause: error}
|
||||
`Failed to fetch GraalVM EA version information for '${javaEaVersion}'`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,14 +5,14 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import semver from 'semver';
|
||||
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {IJetBrainsRawVersion, IJetBrainsVersion} from './models.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {IJetBrainsRawVersion, IJetBrainsVersion} from './models';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
import {extractJdkFile, isVersionSatisfies} from '../../util.js';
|
||||
} from '../base-models';
|
||||
import {extractJdkFile, isVersionSatisfies} from '../../util';
|
||||
import {OutgoingHttpHeaders} from 'http';
|
||||
import {HttpCodes} from '@actions/http-client';
|
||||
|
||||
|
||||
@ -5,19 +5,19 @@ import semver from 'semver';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {IKonaReleaseInfo, IKonaRelease} from './models.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {IKonaReleaseInfo, IKonaRelease} from './models';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
isVersionSatisfies,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
} from '../../util';
|
||||
|
||||
export class KonaDistribution extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import semver from 'semver';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
isVersionSatisfies,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
} from '../../util';
|
||||
import * as core from '@actions/core';
|
||||
import {ArchitectureOptions, LibericaVersion, OsVersions} from './models.js';
|
||||
import {ArchitectureOptions, LibericaVersion, OsVersions} from './models';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
@ -4,14 +4,14 @@ import * as core from '@actions/core';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
JavaInstallerOptions,
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
import {extractJdkFile} from '../../util.js';
|
||||
import {MACOS_JAVA_CONTENT_POSTFIX} from '../../constants.js';
|
||||
} from '../base-models';
|
||||
import {extractJdkFile} from '../../util';
|
||||
import {MACOS_JAVA_CONTENT_POSTFIX} from '../../constants';
|
||||
|
||||
export class LocalDistribution extends JavaBase {
|
||||
constructor(
|
||||
|
||||
@ -1,24 +1,24 @@
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
getGitHubHttpHeaders,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
import * as gpg from '../../gpg.js';
|
||||
import {MICROSOFT_PUBLIC_KEY} from './microsoft-key.js';
|
||||
} from '../../util';
|
||||
import * as gpg from '../../gpg';
|
||||
import {MICROSOFT_PUBLIC_KEY} from './microsoft-key';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {TypedResponse} from '@actions/http-client/lib/interfaces';
|
||||
|
||||
export {MICROSOFT_PUBLIC_KEY} from './microsoft-key.js';
|
||||
export {MICROSOFT_PUBLIC_KEY} from './microsoft-key';
|
||||
|
||||
export class MicrosoftDistributions extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
@ -48,8 +48,7 @@ export class MicrosoftDistributions extends JavaBase {
|
||||
);
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`Failed to verify signature for Microsoft Build of OpenJDK version ${javaRelease.version}. Signature URL: ${javaRelease.signatureUrl}. Error: ${(error as Error).message}`,
|
||||
{cause: error}
|
||||
`Failed to verify signature for Microsoft Build of OpenJDK version ${javaRelease.version}. Signature URL: ${javaRelease.signatureUrl}. Error: ${(error as Error).message}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,19 +4,18 @@ import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
} from '../../util';
|
||||
import {HttpCodes} from '@actions/http-client';
|
||||
import {OsVersions} from './models.js';
|
||||
|
||||
const ORACLE_DL_BASE = 'https://download.oracle.com/java';
|
||||
|
||||
|
||||
@ -10,14 +10,14 @@ import {
|
||||
getDownloadArchiveExtension,
|
||||
isVersionSatisfies,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
} from '../../util';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
import {ISapMachineAllVersions, ISapMachineVersions} from './models.js';
|
||||
} from '../base-models';
|
||||
import {ISapMachineAllVersions, ISapMachineVersions} from './models';
|
||||
|
||||
export class SapMachineDistribution extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import semver from 'semver';
|
||||
import {
|
||||
extractJdkFile,
|
||||
@ -13,12 +13,12 @@ import {
|
||||
renameWinArchive,
|
||||
MAX_PAGINATION_PAGES,
|
||||
validatePaginationUrl
|
||||
} from '../../util.js';
|
||||
} from '../../util';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {ISemeruAvailableVersions} from './models.js';
|
||||
import {ISemeruAvailableVersions} from './models';
|
||||
|
||||
const supportedArchitectures = [
|
||||
'x64',
|
||||
|
||||
@ -4,16 +4,16 @@ import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import semver from 'semver';
|
||||
import * as gpg from '../../gpg.js';
|
||||
import * as gpg from '../../gpg';
|
||||
|
||||
import {ADOPTIUM_PUBLIC_KEY} from './adoptium-key.js';
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {ITemurinAvailableVersions} from './models.js';
|
||||
import {ADOPTIUM_PUBLIC_KEY} from './adoptium-key';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {ITemurinAvailableVersions} from './models';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getNextPageUrlFromLinkHeader,
|
||||
@ -22,9 +22,9 @@ import {
|
||||
renameWinArchive,
|
||||
MAX_PAGINATION_PAGES,
|
||||
validatePaginationUrl
|
||||
} from '../../util.js';
|
||||
} from '../../util';
|
||||
|
||||
export {ADOPTIUM_PUBLIC_KEY} from './adoptium-key.js';
|
||||
export {ADOPTIUM_PUBLIC_KEY} from './adoptium-key';
|
||||
|
||||
export enum TemurinImplementation {
|
||||
Hotspot = 'Hotspot'
|
||||
@ -102,8 +102,7 @@ export class TemurinDistribution extends JavaBase {
|
||||
throw new Error(
|
||||
`Failed to verify signature for Temurin version ${javaRelease.version} from ${javaRelease.signatureUrl}: ${
|
||||
(error as Error).message
|
||||
}`,
|
||||
{cause: error}
|
||||
}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,20 +5,20 @@ import path from 'path';
|
||||
import fs from 'fs';
|
||||
import semver from 'semver';
|
||||
|
||||
import {JavaBase} from '../base-installer.js';
|
||||
import {IZuluVersions} from './models.js';
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {IZuluVersions} from './models';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
convertVersionToSemver,
|
||||
isVersionSatisfies,
|
||||
renameWinArchive
|
||||
} from '../../util.js';
|
||||
} from '../../util';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models.js';
|
||||
} from '../base-models';
|
||||
|
||||
export class ZuluDistribution extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
@ -30,24 +30,17 @@ export class ZuluDistribution extends JavaBase {
|
||||
): Promise<JavaDownloadRelease> {
|
||||
const availableVersionsRaw = await this.getAvailableVersions();
|
||||
const availableVersions = availableVersionsRaw.map(item => {
|
||||
// The Azul Metadata API reports the JDK build number separately from
|
||||
// java_version (e.g. java_version=[17,0,7], openjdk_build_number=7).
|
||||
// Append it so the resulting semver retains the build (e.g. 17.0.7+7).
|
||||
const javaVersion =
|
||||
item.openjdk_build_number != null
|
||||
? [...item.java_version, item.openjdk_build_number]
|
||||
: item.java_version;
|
||||
return {
|
||||
version: convertVersionToSemver(javaVersion),
|
||||
url: item.download_url,
|
||||
zuluVersion: convertVersionToSemver(item.distro_version)
|
||||
version: convertVersionToSemver(item.jdk_version),
|
||||
url: item.url,
|
||||
zuluVersion: convertVersionToSemver(item.zulu_version)
|
||||
};
|
||||
});
|
||||
|
||||
const satisfiedVersions = availableVersions
|
||||
.filter(item => isVersionSatisfies(version, item.version))
|
||||
.sort((a, b) => {
|
||||
// Azul provides two versions: java_version and distro_version
|
||||
// Azul provides two versions: jdk_version and azul_version
|
||||
// we should sort by both fields by descending
|
||||
return (
|
||||
-semver.compareBuild(a.version, b.version) ||
|
||||
@ -102,76 +95,45 @@ export class ZuluDistribution extends JavaBase {
|
||||
}
|
||||
|
||||
private async getAvailableVersions(): Promise<IZuluVersions[]> {
|
||||
const arch = this.getArchitectureOptions();
|
||||
const {arch, hw_bitness, abi} = this.getArchitectureOptions();
|
||||
const [bundleType, features] = this.packageType.split('+');
|
||||
const platform = this.getPlatformOption();
|
||||
const extension = getDownloadArchiveExtension();
|
||||
const javafx = features?.includes('fx') ?? false;
|
||||
const crac = features?.includes('crac') ?? false;
|
||||
const releaseStatus = this.stable ? 'ga' : 'ea';
|
||||
|
||||
if (core.isDebug()) {
|
||||
console.time('Retrieving available versions for Zulu took'); // eslint-disable-line no-console
|
||||
}
|
||||
|
||||
const baseRequestArguments = [
|
||||
const requestArguments = [
|
||||
`os=${platform}`,
|
||||
`archive_type=${extension}`,
|
||||
`java_package_type=${bundleType}`,
|
||||
`javafx_bundled=${javafx}`,
|
||||
`crac_supported=${crac}`,
|
||||
`ext=${extension}`,
|
||||
`bundle_type=${bundleType}`,
|
||||
`javafx=${javafx}`,
|
||||
`arch=${arch}`,
|
||||
`hw_bitness=${hw_bitness}`,
|
||||
`release_status=${releaseStatus}`,
|
||||
`availability_types=ca`
|
||||
].join('&');
|
||||
abi ? `abi=${abi}` : null,
|
||||
features ? `features=${features}` : null
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join('&');
|
||||
|
||||
// Need to iterate through all pages to retrieve the list of all versions.
|
||||
// The Azul API doesn't return a total page count, so paginate until a page
|
||||
// comes back empty (or short), guarding against a runaway loop with a cap.
|
||||
const pageSize = 100;
|
||||
const maxPages = 100;
|
||||
let pageIndex = 1;
|
||||
const availableVersions: IZuluVersions[] = [];
|
||||
while (pageIndex <= maxPages) {
|
||||
const requestArguments = `${baseRequestArguments}&page=${pageIndex}&page_size=${pageSize}`;
|
||||
const availableVersionsUrl = `https://api.azul.com/metadata/v1/zulu/packages/?${requestArguments}`;
|
||||
if (core.isDebug() && pageIndex === 1) {
|
||||
// the url is identical except for the page number, so print it once for debug
|
||||
core.debug(
|
||||
`Gathering available versions from '${availableVersionsUrl}'`
|
||||
);
|
||||
}
|
||||
const availableVersionsUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?${requestArguments}`;
|
||||
|
||||
const paginationPage = (
|
||||
await this.http.getJson<IZuluVersions[]>(availableVersionsUrl)
|
||||
).result;
|
||||
if (!paginationPage || paginationPage.length === 0) {
|
||||
// stop paginating because we have reached the end of the results
|
||||
break;
|
||||
}
|
||||
core.debug(`Gathering available versions from '${availableVersionsUrl}'`);
|
||||
|
||||
availableVersions.push(...paginationPage);
|
||||
|
||||
if (paginationPage.length < pageSize) {
|
||||
// a short page means this was the last one; avoid an extra empty request
|
||||
break;
|
||||
}
|
||||
|
||||
pageIndex++;
|
||||
}
|
||||
|
||||
if (pageIndex > maxPages) {
|
||||
core.warning(
|
||||
`Reached the maximum of ${maxPages} pages while listing Zulu versions; results may be truncated.`
|
||||
);
|
||||
}
|
||||
const availableVersions =
|
||||
(await this.http.getJson<Array<IZuluVersions>>(availableVersionsUrl))
|
||||
.result ?? [];
|
||||
|
||||
if (core.isDebug()) {
|
||||
core.startGroup('Print information about available versions');
|
||||
console.timeEnd('Retrieving available versions for Zulu took'); // eslint-disable-line no-console
|
||||
core.debug(`Available versions: [${availableVersions.length}]`);
|
||||
core.debug(
|
||||
availableVersions.map(item => item.java_version.join('.')).join(', ')
|
||||
availableVersions.map(item => item.jdk_version.join('.')).join(', ')
|
||||
);
|
||||
core.endGroup();
|
||||
}
|
||||
@ -179,22 +141,22 @@ export class ZuluDistribution extends JavaBase {
|
||||
return availableVersions;
|
||||
}
|
||||
|
||||
private getArchitectureOptions(): string {
|
||||
private getArchitectureOptions(): {
|
||||
arch: string;
|
||||
hw_bitness: string;
|
||||
abi: string;
|
||||
} {
|
||||
const arch = this.distributionArchitecture();
|
||||
switch (arch) {
|
||||
case 'x64':
|
||||
return 'x64';
|
||||
return {arch: 'x86', hw_bitness: '64', abi: ''};
|
||||
case 'x86':
|
||||
// The Azul Metadata API's "x86" value returns both 32-bit (i686) and
|
||||
// 64-bit (x64) packages, which are indistinguishable by version and
|
||||
// would let a 32-bit request resolve to a 64-bit JDK. Use "i686" to
|
||||
// target only genuine 32-bit builds, matching the legacy API behavior.
|
||||
return 'i686';
|
||||
return {arch: 'x86', hw_bitness: '32', abi: ''};
|
||||
case 'aarch64':
|
||||
case 'arm64':
|
||||
return 'aarch64';
|
||||
return {arch: 'arm', hw_bitness: '64', abi: ''};
|
||||
default:
|
||||
return arch;
|
||||
return {arch: arch, hw_bitness: '', abi: ''};
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,10 +167,6 @@ export class ZuluDistribution extends JavaBase {
|
||||
return 'macos';
|
||||
case 'win32':
|
||||
return 'windows';
|
||||
case 'linux':
|
||||
// The new Metadata API's "linux" value returns both glibc and musl packages;
|
||||
// use "linux_glibc" to target only glibc, which is what standard runners use.
|
||||
return 'linux_glibc';
|
||||
default:
|
||||
return process.platform;
|
||||
}
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
// Models from https://app.swaggerhub.com/apis/azul/metadata/1.0
|
||||
// Models from https://app.swaggerhub.com/apis-docs/azul/zulu-download-community/1.0
|
||||
|
||||
export interface IZuluVersions {
|
||||
package_uuid: string;
|
||||
id: number;
|
||||
name: string;
|
||||
download_url: string;
|
||||
java_version: Array<number>;
|
||||
distro_version: Array<number>;
|
||||
openjdk_build_number: number;
|
||||
latest: boolean;
|
||||
availability_type: string;
|
||||
url: string;
|
||||
jdk_version: Array<number>;
|
||||
zulu_version: Array<number>;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user