mirror of
https://github.com/actions/setup-java.git
synced 2025-09-06 15:42:54 +08:00
Compare commits
2 Commits
d23d728909
...
258b03bc3c
Author | SHA1 | Date | |
---|---|---|---|
|
258b03bc3c | ||
|
0913e9a06e |
2
.github/workflows/basic-validation.yml
vendored
2
.github/workflows/basic-validation.yml
vendored
@ -16,4 +16,4 @@ jobs:
|
|||||||
name: Basic validation
|
name: Basic validation
|
||||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '24.x'
|
||||||
|
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
@ -16,4 +16,4 @@ jobs:
|
|||||||
name: Check dist/
|
name: Check dist/
|
||||||
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version: '24.x'
|
||||||
|
@ -24,13 +24,13 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for gradle
|
- name: Run setup-java with the cache for gradle
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
java-version: '11'
|
java-version: '17'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
cache-dependency-path: __tests__/cache/gradle1/*.gradle*
|
cache-dependency-path: __tests__/cache/gradle1/*.gradle*
|
||||||
- name: Create files to cache
|
- name: Create files to cache
|
||||||
@ -51,7 +51,7 @@ jobs:
|
|||||||
needs: gradle1-save
|
needs: gradle1-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for gradle
|
- name: Run setup-java with the cache for gradle
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -76,7 +76,7 @@ jobs:
|
|||||||
needs: gradle1-save
|
needs: gradle1-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for gradle
|
- name: Run setup-java with the cache for gradle
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
|
14
.github/workflows/e2e-cache.yml
vendored
14
.github/workflows/e2e-cache.yml
vendored
@ -24,13 +24,13 @@ jobs:
|
|||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-13, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for gradle
|
- name: Run setup-java with the cache for gradle
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
java-version: '11'
|
java-version: '17'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
- name: Create files to cache
|
- name: Create files to cache
|
||||||
# Need to avoid using Gradle daemon to stabilize the save process on Windows
|
# Need to avoid using Gradle daemon to stabilize the save process on Windows
|
||||||
@ -50,7 +50,7 @@ jobs:
|
|||||||
needs: gradle-save
|
needs: gradle-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for gradle
|
- name: Run setup-java with the cache for gradle
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -73,7 +73,7 @@ jobs:
|
|||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-13, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for maven
|
- name: Run setup-java with the cache for maven
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -97,7 +97,7 @@ jobs:
|
|||||||
needs: maven-save
|
needs: maven-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for maven
|
- name: Run setup-java with the cache for maven
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -124,7 +124,7 @@ jobs:
|
|||||||
os: [macos-13, windows-latest, ubuntu-22.04]
|
os: [macos-13, windows-latest, ubuntu-22.04]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for sbt
|
- name: Run setup-java with the cache for sbt
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -174,7 +174,7 @@ jobs:
|
|||||||
needs: sbt-save
|
needs: sbt-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Run setup-java with the cache for sbt
|
- name: Run setup-java with the cache for sbt
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
|
6
.github/workflows/e2e-local-file.yml
vendored
6
.github/workflows/e2e-local-file.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Download Adopt OpenJDK file
|
- name: Download Adopt OpenJDK file
|
||||||
run: |
|
run: |
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
@ -58,7 +58,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Download Zulu OpenJDK file
|
- name: Download Zulu OpenJDK file
|
||||||
run: |
|
run: |
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
@ -95,7 +95,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Download Eclipse Temurin file
|
- name: Download Eclipse Temurin file
|
||||||
run: |
|
run: |
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
|
8
.github/workflows/e2e-publishing.yml
vendored
8
.github/workflows/e2e-publishing.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -60,7 +60,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Create fake settings.xml
|
- name: Create fake settings.xml
|
||||||
run: |
|
run: |
|
||||||
$xmlDirectory = Join-Path $HOME ".m2"
|
$xmlDirectory = Join-Path $HOME ".m2"
|
||||||
@ -96,7 +96,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Create fake settings.xml
|
- name: Create fake settings.xml
|
||||||
run: |
|
run: |
|
||||||
$xmlDirectory = Join-Path $HOME ".m2"
|
$xmlDirectory = Join-Path $HOME ".m2"
|
||||||
@ -133,7 +133,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
|
26
.github/workflows/e2e-versions.yml
vendored
26
.github/workflows/e2e-versions.yml
vendored
@ -64,7 +64,7 @@ jobs:
|
|||||||
version: '24-ea'
|
version: '24-ea'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -114,7 +114,7 @@ jobs:
|
|||||||
version: '17.0.7'
|
version: '17.0.7'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -149,7 +149,7 @@ jobs:
|
|||||||
os: macos-latest
|
os: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -185,7 +185,7 @@ jobs:
|
|||||||
os: macos-latest
|
os: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -224,7 +224,7 @@ jobs:
|
|||||||
version: ['17-ea', '15.0.0-ea.14']
|
version: ['17-ea', '15.0.0-ea.14']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -246,7 +246,7 @@ jobs:
|
|||||||
version: ['17-ea']
|
version: ['17-ea']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -268,7 +268,7 @@ jobs:
|
|||||||
version: ['17-ea', '21-ea']
|
version: ['17-ea', '21-ea']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -355,7 +355,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -383,7 +383,7 @@ jobs:
|
|||||||
version: ['11']
|
version: ['11']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -406,7 +406,7 @@ jobs:
|
|||||||
java-version-file: ['.java-version', '.tool-versions']
|
java-version-file: ['.java-version', '.tool-versions']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "17" > .java-version
|
run: echo "17" > .java-version
|
||||||
@ -435,7 +435,7 @@ jobs:
|
|||||||
java-version-file: ['.java-version', '.tool-versions']
|
java-version-file: ['.java-version', '.tool-versions']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "11" > .java-version
|
run: echo "11" > .java-version
|
||||||
@ -463,7 +463,7 @@ jobs:
|
|||||||
java-version-file: ['.java-version', '.tool-versions']
|
java-version-file: ['.java-version', '.tool-versions']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "17.0.10" > .java-version
|
run: echo "17.0.10" > .java-version
|
||||||
@ -491,7 +491,7 @@ jobs:
|
|||||||
java-version-file: ['.java-version', '.tool-versions']
|
java-version-file: ['.java-version', '.tool-versions']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "openjdk64-17.0.10" > .java-version
|
run: echo "openjdk64-17.0.10" > .java-version
|
||||||
|
@ -15,7 +15,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checking out
|
- name: Checking out
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
- name: Publish
|
- name: Publish
|
||||||
id: publish
|
id: publish
|
||||||
uses: actions/publish-immutable-action@v0.0.4
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
|
2
.licenses/npm/@types/node.dep.yml
generated
2
.licenses/npm/@types/node.dep.yml
generated
@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@types/node"
|
name: "@types/node"
|
||||||
version: 20.11.24
|
version: 24.1.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: TypeScript definitions for node
|
summary: TypeScript definitions for node
|
||||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
|
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
|
||||||
|
6
.licenses/npm/undici-types.dep.yml
generated
6
.licenses/npm/undici-types.dep.yml
generated
@ -1,15 +1,17 @@
|
|||||||
---
|
---
|
||||||
name: undici-types
|
name: undici-types
|
||||||
version: 5.26.5
|
version: 7.8.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: A stand-alone types package for Undici
|
summary: A stand-alone types package for Undici
|
||||||
homepage: https://undici.nodejs.org
|
homepage: https://undici.nodejs.org
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: Auto-generated MIT license text
|
- sources: LICENSE
|
||||||
text: |
|
text: |
|
||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Matteo Collina and Undici contributors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
|
@ -191,7 +191,9 @@ describe('getAvailableVersions', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: string) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const installerOptions: JavaInstallerOptions = {
|
const installerOptions: JavaInstallerOptions = {
|
||||||
version: '17',
|
version: '17',
|
||||||
|
@ -287,7 +287,7 @@ describe('setupJava', () => {
|
|||||||
spyCoreSetOutput = jest.spyOn(core, 'setOutput');
|
spyCoreSetOutput = jest.spyOn(core, 'setOutput');
|
||||||
spyCoreSetOutput.mockImplementation(() => undefined);
|
spyCoreSetOutput.mockImplementation(() => undefined);
|
||||||
|
|
||||||
jest.spyOn(os, 'arch').mockReturnValue('x86');
|
jest.spyOn(os, 'arch').mockReturnValue('x86' as ReturnType<typeof os.arch>);
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
@ -203,28 +203,27 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['arm64', 'aarch64'],
|
['amd64', 'x64'],
|
||||||
['amd64', 'x64']
|
['arm64', 'aarch64']
|
||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: string) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const version = '17';
|
const distribution = new CorrettoDistribution({
|
||||||
const installerOptions: JavaInstallerOptions = {
|
version: '17',
|
||||||
version,
|
|
||||||
architecture: '', // to get default value
|
architecture: '', // to get default value
|
||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
};
|
});
|
||||||
|
|
||||||
const distribution = new CorrettoDistribution(installerOptions);
|
|
||||||
mockPlatform(distribution, 'macos');
|
mockPlatform(distribution, 'macos');
|
||||||
|
|
||||||
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
|
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
const availableVersion = await distribution['findPackageForDownload'](
|
||||||
version
|
'17'
|
||||||
);
|
);
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
|
@ -98,31 +98,35 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['amd64', 'x64'],
|
['amd64', ['x64', 'amd64']],
|
||||||
['arm64', 'aarch64']
|
['arm64', ['aarch64', 'arm64']]
|
||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: string) => {
|
async (osArch: string, distroArchs: string[]) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const version = '21';
|
const distribution = new GraalVMDistribution({
|
||||||
const distro = new GraalVMDistribution({
|
version: '21',
|
||||||
version,
|
|
||||||
architecture: '', // to get default value
|
architecture: '', // to get default value
|
||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
|
|
||||||
const osType = distribution.getPlatform();
|
const osType = distribution.getPlatform();
|
||||||
if (osType === 'windows' && distroArch == 'aarch64') {
|
if (osType === 'windows' && distroArchs.includes('aarch64')) {
|
||||||
return; // skip, aarch64 is not available for Windows
|
return; // skip, aarch64 is not available for Windows
|
||||||
}
|
}
|
||||||
const archiveType = getDownloadArchiveExtension();
|
const archiveType = getDownloadArchiveExtension();
|
||||||
const result = await distro['findPackageForDownload'](version);
|
const result = await distribution['findPackageForDownload']('21');
|
||||||
const expectedUrl = `https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}`;
|
|
||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -105,9 +105,11 @@ describe('getAvailableVersions', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const distribution = new LibericaDistributions({
|
const distributions = new LibericaDistributions({
|
||||||
version: '17',
|
version: '17',
|
||||||
architecture: '', // to get default value
|
architecture: '', // to get default value
|
||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
@ -117,11 +119,11 @@ describe('getAvailableVersions', () => {
|
|||||||
const additionalParams =
|
const additionalParams =
|
||||||
'&installation-type=archive&fields=downloadUrl%2Cversion%2CfeatureVersion%2CinterimVersion%2C' +
|
'&installation-type=archive&fields=downloadUrl%2Cversion%2CfeatureVersion%2CinterimVersion%2C' +
|
||||||
'updateVersion%2CbuildVersion';
|
'updateVersion%2CbuildVersion';
|
||||||
distribution['getPlatformOption'] = () => 'macos';
|
distributions['getPlatformOption'] = () => 'macos';
|
||||||
|
|
||||||
const buildUrl = `https://api.bell-sw.com/v1/liberica/releases?os=macos&bundle-type=jdk&bitness=${distroArch.bitness}&arch=${distroArch.arch}&build-type=all${additionalParams}`;
|
const buildUrl = `https://api.bell-sw.com/v1/liberica/releases?os=macos&bundle-type=jdk&bitness=${distroArch.bitness}&arch=${distroArch.arch}&build-type=all${additionalParams}`;
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
await distributions['getAvailableVersions']();
|
||||||
|
|
||||||
expect(spyHttpClient.mock.calls).toHaveLength(1);
|
expect(spyHttpClient.mock.calls).toHaveLength(1);
|
||||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||||
|
@ -105,7 +105,9 @@ describe('getAvailableVersions', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const distribution = new LibericaDistributions({
|
const distribution = new LibericaDistributions({
|
||||||
version: '17',
|
version: '17',
|
||||||
|
@ -105,7 +105,9 @@ describe('getAvailableVersions', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const distribution = new LibericaDistributions({
|
const distribution = new LibericaDistributions({
|
||||||
version: '17',
|
version: '17',
|
||||||
|
@ -95,7 +95,9 @@ describe('findPackageForDownload', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: string) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('darwin');
|
jest.spyOn(os, 'platform').mockReturnValue('darwin');
|
||||||
|
|
||||||
const version = '17';
|
const version = '17';
|
||||||
@ -119,7 +121,9 @@ describe('findPackageForDownload', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: string) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
||||||
|
|
||||||
const version = '17';
|
const version = '17';
|
||||||
@ -143,7 +147,9 @@ describe('findPackageForDownload', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: string) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('win32');
|
jest.spyOn(os, 'platform').mockReturnValue('win32');
|
||||||
|
|
||||||
const version = '17';
|
const version = '17';
|
||||||
|
@ -95,7 +95,9 @@ describe('findPackageForDownload', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: string) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
||||||
|
|
||||||
const version = '18';
|
const version = '18';
|
||||||
|
@ -147,7 +147,9 @@ describe('getAvailableVersions', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: string) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(distroArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const installerOptions: JavaInstallerOptions = {
|
const installerOptions: JavaInstallerOptions = {
|
||||||
version: '17',
|
version: '17',
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
import {HttpClient} from '@actions/http-client';
|
||||||
import * as semver from 'semver';
|
|
||||||
import {ZuluDistribution} from '../../src/distributions/zulu/installer';
|
import {ZuluDistribution} from '../../src/distributions/zulu/installer';
|
||||||
import {IZuluVersions} from '../../src/distributions/zulu/models';
|
import {IZuluVersions} from '../../src/distributions/zulu/models';
|
||||||
import * as utils from '../../src/util';
|
import * as utils from '../../src/util';
|
||||||
@ -126,7 +125,9 @@ describe('getAvailableVersions', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const distribution = new ZuluDistribution({
|
const distribution = new ZuluDistribution({
|
||||||
version: '17',
|
version: '17',
|
||||||
|
@ -126,7 +126,9 @@ describe('getAvailableVersions', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const distribution = new ZuluDistribution({
|
const distribution = new ZuluDistribution({
|
||||||
version: '17',
|
version: '17',
|
||||||
@ -135,7 +137,9 @@ describe('getAvailableVersions', () => {
|
|||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
distribution['getPlatformOption'] = () => 'linux';
|
distribution['getPlatformOption'] = () => 'linux';
|
||||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=${distroArch.arch}&hw_bitness=${distroArch.bitness}&release_status=ga`;
|
// Override extension for linux default arch case to match util behavior
|
||||||
|
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||||
|
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']();
|
await distribution['getAvailableVersions']();
|
||||||
|
|
||||||
|
@ -126,7 +126,9 @@ describe('getAvailableVersions', () => {
|
|||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest
|
||||||
|
.spyOn(os, 'arch')
|
||||||
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
|
|
||||||
const distribution = new ZuluDistribution({
|
const distribution = new ZuluDistribution({
|
||||||
version: '17',
|
version: '17',
|
||||||
|
@ -81,6 +81,6 @@ outputs:
|
|||||||
cache-hit:
|
cache-hit:
|
||||||
description: 'A boolean value to indicate an exact match was found for the primary key'
|
description: 'A boolean value to indicate an exact match was found for the primary key'
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node24'
|
||||||
main: 'dist/setup/index.js'
|
main: 'dist/setup/index.js'
|
||||||
post: 'dist/cleanup/index.js'
|
post: 'dist/cleanup/index.js'
|
||||||
|
25
package-lock.json
generated
25
package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-java",
|
"name": "setup-java",
|
||||||
"version": "4.0.0",
|
"version": "5.0.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "setup-java",
|
"name": "setup-java",
|
||||||
"version": "4.0.0",
|
"version": "5.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^4.0.3",
|
"@actions/cache": "^4.0.3",
|
||||||
@ -21,7 +21,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/node": "^20.11.24",
|
"@types/node": "^24.1.0",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
||||||
"@typescript-eslint/parser": "^8.35.1",
|
"@typescript-eslint/parser": "^8.35.1",
|
||||||
@ -35,6 +35,9 @@
|
|||||||
"prettier": "^2.8.4",
|
"prettier": "^2.8.4",
|
||||||
"ts-jest": "^29.3.0",
|
"ts-jest": "^29.3.0",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "^5.3.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aashutoshrathi/word-wrap": {
|
"node_modules/@aashutoshrathi/word-wrap": {
|
||||||
@ -1644,11 +1647,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node": {
|
"node_modules/@types/node": {
|
||||||
"version": "20.11.24",
|
"version": "24.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.1.0.tgz",
|
||||||
"integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==",
|
"integrity": "sha512-ut5FthK5moxFKH2T1CUOC6ctR67rQRvvHdFLCD2Ql6KXmMuCrjsSsRI9UsLCm9M18BMwClv4pn327UvB7eeO1w==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~5.26.4"
|
"undici-types": "~7.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@types/node-fetch": {
|
"node_modules/@types/node-fetch": {
|
||||||
@ -5510,9 +5514,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici-types": {
|
"node_modules/undici-types": {
|
||||||
"version": "5.26.5",
|
"version": "7.8.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.8.0.tgz",
|
||||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
|
"integrity": "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw==",
|
||||||
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/update-browserslist-db": {
|
"node_modules/update-browserslist-db": {
|
||||||
"version": "1.0.13",
|
"version": "1.0.13",
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-java",
|
"name": "setup-java",
|
||||||
"version": "4.0.0",
|
"version": "5.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup java action",
|
"description": "setup java action",
|
||||||
"main": "dist/setup/index.js",
|
"main": "dist/setup/index.js",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=24.0.0"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts",
|
"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 --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
|
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
|
||||||
@ -38,7 +41,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^29.5.14",
|
"@types/jest": "^29.5.14",
|
||||||
"@types/node": "^20.11.24",
|
"@types/node": "^24.1.0",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/semver": "^7.5.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
"@typescript-eslint/eslint-plugin": "^8.35.1",
|
||||||
"@typescript-eslint/parser": "^8.35.1",
|
"@typescript-eslint/parser": "^8.35.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user