mirror of
https://github.com/actions/setup-java.git
synced 2025-09-10 12:37:08 +00:00
Upgrade to node 24 (#888)
* Upgrade to node 24 Upgrading action to node 24 since new runner version. * fix tests * Fix tests and licences * format * format x2 * Upgrade Node.js version in workflow files to 24.x * check failure fix * check failures fix * Fix mock platform --------- Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com> Co-authored-by: Haritha <73516759+HarithaVattikuti@users.noreply.github.com>
This commit is contained in:
parent
e9343db97e
commit
0913e9a06e
22 changed files with 98 additions and 60 deletions
|
@ -98,31 +98,35 @@ describe('findPackageForDownload', () => {
|
|||
});
|
||||
|
||||
it.each([
|
||||
['amd64', 'x64'],
|
||||
['arm64', 'aarch64']
|
||||
['amd64', ['x64', 'amd64']],
|
||||
['arm64', ['aarch64', 'arm64']]
|
||||
])(
|
||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||
async (osArch: string, distroArch: string) => {
|
||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
||||
async (osArch: string, distroArchs: string[]) => {
|
||||
jest
|
||||
.spyOn(os, 'arch')
|
||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||
|
||||
const version = '21';
|
||||
const distro = new GraalVMDistribution({
|
||||
version,
|
||||
const distribution = new GraalVMDistribution({
|
||||
version: '21',
|
||||
architecture: '', // to get default value
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
const osType = distribution.getPlatform();
|
||||
if (osType === 'windows' && distroArch == 'aarch64') {
|
||||
if (osType === 'windows' && distroArchs.includes('aarch64')) {
|
||||
return; // skip, aarch64 is not available for Windows
|
||||
}
|
||||
const archiveType = getDownloadArchiveExtension();
|
||||
const result = await distro['findPackageForDownload'](version);
|
||||
const expectedUrl = `https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}`;
|
||||
const result = await distribution['findPackageForDownload']('21');
|
||||
|
||||
expect(result.url).toBe(expectedUrl);
|
||||
const expectedUrls = distroArchs.map(
|
||||
distroArch =>
|
||||
`https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}`
|
||||
);
|
||||
|
||||
expect(expectedUrls).toContain(result.url);
|
||||
}
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue