mirror of
https://github.com/actions/setup-java.git
synced 2025-03-13 17:47:03 +00:00
Fix formatting to match prettier.
This commit is contained in:
parent
1bc25281d6
commit
9c1600ace3
4 changed files with 52 additions and 34 deletions
|
@ -4,7 +4,7 @@ import { ArchitectureOptions } from '../../src/distributions/microsoft/models';
|
||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
['x64', { bitness: '64', arch: 'x86' }],
|
['x64', { bitness: '64', arch: 'x86' }],
|
||||||
['aarch64', { bitness: '64', arch: 'arm' }],
|
['aarch64', { bitness: '64', arch: 'arm' }]
|
||||||
] as [string, ArchitectureOptions][])('parse architecture %s -> %s', (input, expected) => {
|
] as [string, ArchitectureOptions][])('parse architecture %s -> %s', (input, expected) => {
|
||||||
const distributions = new MicrosoftDistributions({
|
const distributions = new MicrosoftDistributions({
|
||||||
architecture: input,
|
architecture: input,
|
||||||
|
@ -43,9 +43,21 @@ describe('findPackageForDownload', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['17.x', '17.0.1', 'https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-{{OS_TYPE}}-x64.tar.gz'],
|
[
|
||||||
['16.0.x', '16.0.2', 'https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-{{OS_TYPE}}-x64.tar.gz'],
|
'17.x',
|
||||||
['11.0.13', '11.0.13', 'https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-{{OS_TYPE}}-x64.tar.gz'],
|
'17.0.1',
|
||||||
|
'https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-{{OS_TYPE}}-x64.tar.gz'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'16.0.x',
|
||||||
|
'16.0.2',
|
||||||
|
'https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-{{OS_TYPE}}-x64.tar.gz'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'11.0.13',
|
||||||
|
'11.0.13',
|
||||||
|
'https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-{{OS_TYPE}}-x64.tar.gz'
|
||||||
|
]
|
||||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
||||||
const result = await distribution['findPackageForDownload'](input);
|
const result = await distribution['findPackageForDownload'](input);
|
||||||
expect(result.version).toBe(expectedVersion);
|
expect(result.version).toBe(expectedVersion);
|
||||||
|
@ -82,7 +94,7 @@ describe('getPlatformOption', () => {
|
||||||
it.each([
|
it.each([
|
||||||
['linux', 'linux'],
|
['linux', 'linux'],
|
||||||
['darwin', 'macos'],
|
['darwin', 'macos'],
|
||||||
['win32', 'windows'],
|
['win32', 'windows']
|
||||||
])('os version %s -> %s', (input, expected) => {
|
])('os version %s -> %s', (input, expected) => {
|
||||||
const actual = distributions['getPlatformOption'](input as NodeJS.Platform);
|
const actual = distributions['getPlatformOption'](input as NodeJS.Platform);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,9 @@ export class MicrosoftDistributions extends JavaBase {
|
||||||
const availableVersionsRaw = await this.getAvailableVersions();
|
const availableVersionsRaw = await this.getAvailableVersions();
|
||||||
|
|
||||||
const availableVersions = availableVersionsRaw.map(item => ({
|
const availableVersions = availableVersionsRaw.map(item => ({
|
||||||
url: `https://aka.ms/download-jdk/microsoft-jdk-${item.fullVersion}-${this.getPlatformOption()}-${this.architecture}.tar.gz`,
|
url: `https://aka.ms/download-jdk/microsoft-jdk-${
|
||||||
|
item.fullVersion
|
||||||
|
}-${this.getPlatformOption()}-${this.architecture}.tar.gz`,
|
||||||
version: this.convertVersionToSemver(item)
|
version: this.convertVersionToSemver(item)
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
@ -69,22 +71,26 @@ export class MicrosoftDistributions extends JavaBase {
|
||||||
console.time('microsoft-retrieve-available-versions');
|
console.time('microsoft-retrieve-available-versions');
|
||||||
|
|
||||||
// TODO get these dynamically!
|
// TODO get these dynamically!
|
||||||
var jdkVersions = [{
|
var jdkVersions = [
|
||||||
|
{
|
||||||
majorVersion: 17,
|
majorVersion: 17,
|
||||||
minorVersion: 0,
|
minorVersion: 0,
|
||||||
patchVersion: 1,
|
patchVersion: 1,
|
||||||
fullVersion: '17.0.1.12.1'
|
fullVersion: '17.0.1.12.1'
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
majorVersion: 16,
|
majorVersion: 16,
|
||||||
minorVersion: 0,
|
minorVersion: 0,
|
||||||
patchVersion: 2,
|
patchVersion: 2,
|
||||||
fullVersion: '16.0.2.7.1'
|
fullVersion: '16.0.2.7.1'
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
majorVersion: 11,
|
majorVersion: 11,
|
||||||
minorVersion: 0,
|
minorVersion: 0,
|
||||||
patchVersion: 13,
|
patchVersion: 13,
|
||||||
fullVersion: '11.0.13.8.1'
|
fullVersion: '11.0.13.8.1'
|
||||||
}];
|
}
|
||||||
|
];
|
||||||
|
|
||||||
return jdkVersions;
|
return jdkVersions;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue