mirror of
				https://github.com/actions/setup-java.git
				synced 2025-10-31 14:30:53 +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', () => { | ||||
|   it.each([ | ||||
|     ['x64', { bitness: '64', arch: 'x86' }], | ||||
|     ['aarch64', { bitness: '64', arch: 'arm' }], | ||||
|     ['aarch64', { bitness: '64', arch: 'arm' }] | ||||
|   ] as [string, ArchitectureOptions][])('parse architecture %s -> %s', (input, expected) => { | ||||
|     const distributions = new MicrosoftDistributions({ | ||||
|       architecture: input, | ||||
|  | @ -43,9 +43,21 @@ describe('findPackageForDownload', () => { | |||
|   }); | ||||
| 
 | ||||
|   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'], | ||||
|     ['11.0.13', '11.0.13', 'https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-{{OS_TYPE}}-x64.tar.gz'], | ||||
|     [ | ||||
|       '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' | ||||
|     ], | ||||
|     [ | ||||
|       '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) => { | ||||
|     const result = await distribution['findPackageForDownload'](input); | ||||
|     expect(result.version).toBe(expectedVersion); | ||||
|  | @ -82,7 +94,7 @@ describe('getPlatformOption', () => { | |||
|   it.each([ | ||||
|     ['linux', 'linux'], | ||||
|     ['darwin', 'macos'], | ||||
|     ['win32', 'windows'], | ||||
|     ['win32', 'windows'] | ||||
|   ])('os version %s -> %s', (input, expected) => { | ||||
|     const actual = distributions['getPlatformOption'](input as NodeJS.Platform); | ||||
| 
 | ||||
|  |  | |||
|  | @ -44,7 +44,9 @@ export class MicrosoftDistributions extends JavaBase { | |||
|     const availableVersionsRaw = await this.getAvailableVersions(); | ||||
| 
 | ||||
|     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) | ||||
|     })); | ||||
| 
 | ||||
|  | @ -69,22 +71,26 @@ export class MicrosoftDistributions extends JavaBase { | |||
|     console.time('microsoft-retrieve-available-versions'); | ||||
| 
 | ||||
|     // TODO get these dynamically!
 | ||||
|     var jdkVersions = [{ | ||||
|     var jdkVersions = [ | ||||
|       { | ||||
|         majorVersion: 17, | ||||
|         minorVersion: 0, | ||||
|         patchVersion: 1, | ||||
|         fullVersion: '17.0.1.12.1' | ||||
|     }, { | ||||
|       }, | ||||
|       { | ||||
|         majorVersion: 16, | ||||
|         minorVersion: 0, | ||||
|         patchVersion: 2, | ||||
|         fullVersion: '16.0.2.7.1' | ||||
|     }, { | ||||
|       }, | ||||
|       { | ||||
|         majorVersion: 11, | ||||
|         minorVersion: 0, | ||||
|         patchVersion: 13, | ||||
|         fullVersion: '11.0.13.8.1' | ||||
|     }]; | ||||
|       } | ||||
|     ]; | ||||
| 
 | ||||
|     return jdkVersions; | ||||
|   } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue