mirror of
https://github.com/actions/setup-java.git
synced 2026-07-17 14:02:57 +00:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 46f6294045 | |||
| e40a8e0642 | |||
| 6e2e32e729 | |||
| 38fa86f9e4 | |||
| ecd5f809c2 | |||
| 4a24efdcc9 | |||
| cc8cdedf67 | |||
| 4b0728bd0d | |||
| 7d485884af | |||
| c3568cc9d9 | |||
| 81c13a41f9 | |||
| 3c85b14378 | |||
| 80c368b720 | |||
| cd57b95697 | |||
| 7a475d86d1 | |||
| 92f9362dd0 | |||
| 71cfe8e0ed | |||
| eb6157cd13 | |||
| 2adeb10550 | |||
| 23f8c419c6 | |||
| 6f7d7a6eb1 | |||
| 2301a55b6d | |||
| 2789aa9170 | |||
| 28fb8cb06b | |||
| 174d4b5609 | |||
| 86ce8e6cc8 | |||
| 90be2728bc | |||
| 3157986b3f | |||
| 548a822bee | |||
| f848fd1976 | |||
| fe9b749bcb | |||
| 4db08ef6bf | |||
| 7dbccc66ee | |||
| 8a3e8157a1 | |||
| f7121373a9 | |||
| 2a07c83aea | |||
| d3530c1eb4 |
@@ -1,6 +0,0 @@
|
|||||||
# Ignore list
|
|
||||||
/*
|
|
||||||
|
|
||||||
# Do not ignore these folders:
|
|
||||||
!__tests__/
|
|
||||||
!src/
|
|
||||||
@@ -1,51 +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.
|
|
||||||
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
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -21,6 +21,19 @@
|
|||||||
"message": 4
|
"message": 4
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"owner": "maven-javac",
|
||||||
|
"pattern": [
|
||||||
|
{
|
||||||
|
"regexp": "^\\[(WARNING|ERROR)\\]\\s+(.+?\\.java):\\[(\\d+),(\\d+)\\]\\s+(.+)$",
|
||||||
|
"severity": 1,
|
||||||
|
"file": 2,
|
||||||
|
"line": 3,
|
||||||
|
"column": 4,
|
||||||
|
"message": 5
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,102 +0,0 @@
|
|||||||
name: Validate cache with cache-dependency-path option
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/*
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
gradle1-save:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Run setup-java with the cache for gradle
|
|
||||||
uses: ./
|
|
||||||
id: setup-java
|
|
||||||
with:
|
|
||||||
distribution: 'adopt'
|
|
||||||
java-version: '17'
|
|
||||||
cache: gradle
|
|
||||||
cache-dependency-path: __tests__/cache/gradle1/*.gradle*
|
|
||||||
- name: Create files to cache
|
|
||||||
# Need to avoid using Gradle daemon to stabilize the save process on Windows
|
|
||||||
# https://github.com/actions/cache/issues/454#issuecomment-840493935
|
|
||||||
run: |
|
|
||||||
gradle downloadDependencies --no-daemon -p __tests__/cache/gradle1
|
|
||||||
if [ ! -d ~/.gradle/caches ]; then
|
|
||||||
echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
gradle1-restore:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
||||||
needs: gradle1-save
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Run setup-java with the cache for gradle
|
|
||||||
uses: ./
|
|
||||||
id: setup-java
|
|
||||||
with:
|
|
||||||
distribution: 'adopt'
|
|
||||||
java-version: '11'
|
|
||||||
cache: gradle
|
|
||||||
cache-dependency-path: __tests__/cache/gradle1/*.gradle*
|
|
||||||
- name: Confirm that ~/.gradle/caches directory has been made
|
|
||||||
run: |
|
|
||||||
if [ ! -d ~/.gradle/caches ]; then
|
|
||||||
echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
ls ~/.gradle/caches/
|
|
||||||
gradle2-restore:
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
||||||
needs: gradle1-save
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Run setup-java with the cache for gradle
|
|
||||||
uses: ./
|
|
||||||
id: setup-java
|
|
||||||
with:
|
|
||||||
distribution: 'adopt'
|
|
||||||
java-version: '11'
|
|
||||||
cache: gradle
|
|
||||||
cache-dependency-path: __tests__/cache/gradle2/*.gradle*
|
|
||||||
- name: Confirm that ~/.gradle/caches directory has not been made
|
|
||||||
run: |
|
|
||||||
if [ -d ~/.gradle/caches ]; then
|
|
||||||
echo "::error::The ~/.gradle/caches directory exists unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
+255
-54
@@ -42,10 +42,7 @@ jobs:
|
|||||||
# https://github.com/actions/cache/issues/454#issuecomment-840493935
|
# https://github.com/actions/cache/issues/454#issuecomment-840493935
|
||||||
run: |
|
run: |
|
||||||
gradle downloadDependencies --no-daemon -p __tests__/cache/gradle1
|
gradle downloadDependencies --no-daemon -p __tests__/cache/gradle1
|
||||||
if [ ! -d ~/.gradle/caches ]; then
|
bash __tests__/check-dir.sh "$HOME/.gradle/caches"
|
||||||
echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
gradle-restore:
|
gradle-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -66,12 +63,7 @@ jobs:
|
|||||||
java-version: '11'
|
java-version: '11'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
- name: Confirm that ~/.gradle/caches directory has been made
|
- name: Confirm that ~/.gradle/caches directory has been made
|
||||||
run: |
|
run: bash __tests__/check-dir.sh "$HOME/.gradle/caches"
|
||||||
if [ ! -d ~/.gradle/caches ]; then
|
|
||||||
echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
ls ~/.gradle/caches/
|
|
||||||
maven-save:
|
maven-save:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -93,10 +85,7 @@ jobs:
|
|||||||
- name: Create files to cache
|
- name: Create files to cache
|
||||||
run: |
|
run: |
|
||||||
mvn verify -f __tests__/cache/maven/pom.xml
|
mvn verify -f __tests__/cache/maven/pom.xml
|
||||||
if [ ! -d ~/.m2/repository ]; then
|
bash __tests__/check-dir.sh "$HOME/.m2/repository"
|
||||||
echo "::error::The ~/.m2/repository directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
maven-restore:
|
maven-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -117,12 +106,7 @@ jobs:
|
|||||||
java-version: '11'
|
java-version: '11'
|
||||||
cache: maven
|
cache: maven
|
||||||
- name: Confirm that ~/.m2/repository directory has been made
|
- name: Confirm that ~/.m2/repository directory has been made
|
||||||
run: |
|
run: bash __tests__/check-dir.sh "$HOME/.m2/repository"
|
||||||
if [ ! -d ~/.m2/repository ]; then
|
|
||||||
echo "::error::The ~/.m2/repository directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
ls ~/.m2/repository
|
|
||||||
sbt-save:
|
sbt-save:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
defaults:
|
defaults:
|
||||||
@@ -155,25 +139,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Check files to cache on macos-latest
|
- name: Check files to cache on macos-latest
|
||||||
if: matrix.os == 'macos-15-intel'
|
if: matrix.os == 'macos-15-intel'
|
||||||
run: |
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier"
|
||||||
if [ ! -d ~/Library/Caches/Coursier ]; then
|
|
||||||
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Check files to cache on windows-latest
|
- name: Check files to cache on windows-latest
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
|
||||||
if [ ! -d ~/AppData/Local/Coursier/Cache ]; then
|
|
||||||
echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
- name: Check files to cache on ubuntu-latest
|
- name: Check files to cache on ubuntu-latest
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
run: |
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
||||||
if [ ! -d ~/.cache/coursier ]; then
|
|
||||||
echo "::error::The ~/.cache/coursier directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
sbt-restore:
|
sbt-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
defaults:
|
defaults:
|
||||||
@@ -200,25 +172,254 @@ jobs:
|
|||||||
|
|
||||||
- name: Confirm that ~/Library/Caches/Coursier directory has been made
|
- name: Confirm that ~/Library/Caches/Coursier directory has been made
|
||||||
if: matrix.os == 'macos-15-intel'
|
if: matrix.os == 'macos-15-intel'
|
||||||
run: |
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier"
|
||||||
if [ ! -d ~/Library/Caches/Coursier ]; then
|
|
||||||
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
ls ~/Library/Caches/Coursier
|
|
||||||
- name: Confirm that ~/AppData/Local/Coursier/Cache directory has been made
|
- name: Confirm that ~/AppData/Local/Coursier/Cache directory has been made
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
|
||||||
if [ ! -d ~/AppData/Local/Coursier/Cache ]; then
|
|
||||||
echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
ls ~/AppData/Local/Coursier/Cache
|
|
||||||
- name: Confirm that ~/.cache/coursier directory has been made
|
- name: Confirm that ~/.cache/coursier directory has been made
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
||||||
|
gradle1-save:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for gradle
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '17'
|
||||||
|
cache: gradle
|
||||||
|
cache-dependency-path: __tests__/cache/gradle1/*.gradle*
|
||||||
|
- name: Create files to cache
|
||||||
|
# Need to avoid using Gradle daemon to stabilize the save process on Windows
|
||||||
|
# https://github.com/actions/cache/issues/454#issuecomment-840493935
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d ~/.cache/coursier ]; then
|
gradle downloadDependencies --no-daemon -p __tests__/cache/gradle1
|
||||||
echo "::error::The ~/.cache/coursier directory does not exist unexpectedly"
|
bash __tests__/check-dir.sh "$HOME/.gradle/caches"
|
||||||
exit 1
|
gradle1-restore:
|
||||||
fi
|
runs-on: ${{ matrix.os }}
|
||||||
ls ~/.cache/coursier
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
|
needs: gradle1-save
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for gradle
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
cache: gradle
|
||||||
|
cache-dependency-path: __tests__/cache/gradle1/*.gradle*
|
||||||
|
- name: Confirm that ~/.gradle/caches directory has been made
|
||||||
|
run: bash __tests__/check-dir.sh "$HOME/.gradle/caches"
|
||||||
|
gradle2-restore:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
|
needs: gradle1-save
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for gradle
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
cache: gradle
|
||||||
|
cache-dependency-path: __tests__/cache/gradle2/*.gradle*
|
||||||
|
- name: Confirm that ~/.gradle/caches directory has not been made
|
||||||
|
run: bash __tests__/check-dir.sh "$HOME/.gradle/caches" absent
|
||||||
|
maven1-save:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for maven
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
cache: maven
|
||||||
|
cache-dependency-path: __tests__/cache/maven/pom.xml
|
||||||
|
- name: Create files to cache
|
||||||
|
run: |
|
||||||
|
mvn verify -f __tests__/cache/maven/pom.xml
|
||||||
|
bash __tests__/check-dir.sh "$HOME/.m2/repository"
|
||||||
|
maven1-restore:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
|
needs: maven1-save
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for maven
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
cache: maven
|
||||||
|
cache-dependency-path: __tests__/cache/maven/pom.xml
|
||||||
|
- name: Confirm that ~/.m2/repository directory has been made
|
||||||
|
run: bash __tests__/check-dir.sh "$HOME/.m2/repository"
|
||||||
|
maven2-restore:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
|
needs: maven1-save
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for maven
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
cache: maven
|
||||||
|
cache-dependency-path: __tests__/cache/maven2/pom.xml
|
||||||
|
- name: Confirm that ~/.m2/repository directory has not been made
|
||||||
|
run: bash __tests__/check-dir.sh "$HOME/.m2/repository" absent
|
||||||
|
sbt1-save:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
working-directory: __tests__/cache/sbt
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-15-intel, windows-latest, ubuntu-22.04]
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for sbt
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
cache: sbt
|
||||||
|
cache-dependency-path: __tests__/cache/sbt/*.sbt
|
||||||
|
- name: Setup SBT
|
||||||
|
if: matrix.os == 'macos-15-intel'
|
||||||
|
run: |
|
||||||
|
echo ""Installing SBT...""
|
||||||
|
brew install sbt
|
||||||
|
- name: Create files to cache
|
||||||
|
run: sbt update
|
||||||
|
|
||||||
|
- name: Check files to cache on macos-latest
|
||||||
|
if: matrix.os == 'macos-15-intel'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier"
|
||||||
|
- name: Check files to cache on windows-latest
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
|
||||||
|
- name: Check files to cache on ubuntu-latest
|
||||||
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
||||||
|
sbt1-restore:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
working-directory: __tests__/cache/sbt
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-15-intel, windows-latest, ubuntu-22.04]
|
||||||
|
needs: sbt1-save
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for sbt
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
cache: sbt
|
||||||
|
cache-dependency-path: __tests__/cache/sbt/*.sbt
|
||||||
|
|
||||||
|
- name: Confirm that ~/Library/Caches/Coursier directory has been made
|
||||||
|
if: matrix.os == 'macos-15-intel'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier"
|
||||||
|
- name: Confirm that ~/AppData/Local/Coursier/Cache directory has been made
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache"
|
||||||
|
- name: Confirm that ~/.cache/coursier directory has been made
|
||||||
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier"
|
||||||
|
sbt2-restore:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
working-directory: __tests__/cache/sbt2
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [macos-15-intel, windows-latest, ubuntu-22.04]
|
||||||
|
needs: sbt1-save
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v7
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
- name: Run setup-java with the cache for sbt
|
||||||
|
uses: ./
|
||||||
|
id: setup-java
|
||||||
|
with:
|
||||||
|
distribution: 'adopt'
|
||||||
|
java-version: '11'
|
||||||
|
cache: sbt
|
||||||
|
cache-dependency-path: __tests__/cache/sbt2/*.sbt
|
||||||
|
|
||||||
|
- name: Confirm that ~/Library/Caches/Coursier directory has not been made
|
||||||
|
if: matrix.os == 'macos-15-intel'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/Library/Caches/Coursier" absent
|
||||||
|
- name: Confirm that ~/AppData/Local/Coursier/Cache directory has not been made
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/AppData/Local/Coursier/Cache" absent
|
||||||
|
- name: Confirm that ~/.cache/coursier directory has not been made
|
||||||
|
if: matrix.os == 'ubuntu-22.04'
|
||||||
|
run: bash "$GITHUB_WORKSPACE/__tests__/check-dir.sh" "$HOME/.cache/coursier" absent
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ jobs:
|
|||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
|
jdk-file: ${{ runner.temp }}/${{ env.LocalFilename }}
|
||||||
java-version: '11.0.0-ea'
|
java-version: '11.0.0-ea'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
- name: Verify Java version
|
- name: Verify Java version
|
||||||
@@ -88,7 +88,7 @@ jobs:
|
|||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
|
jdk-file: ${{ runner.temp }}/${{ env.LocalFilename }}
|
||||||
java-version: '11.0.0-ea'
|
java-version: '11.0.0-ea'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
- name: Verify Java version
|
- name: Verify Java version
|
||||||
@@ -129,6 +129,7 @@ jobs:
|
|||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
|
# Intentionally uses the deprecated `jdkFile` alias to keep it covered.
|
||||||
jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
|
jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }}
|
||||||
java-version: '11.0.0-ea'
|
java-version: '11.0.0-ea'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
|
|||||||
@@ -46,13 +46,25 @@ jobs:
|
|||||||
$xmlPath = Join-Path $HOME ".m2" "settings.xml"
|
$xmlPath = Join-Path $HOME ".m2" "settings.xml"
|
||||||
Get-Content $xmlPath | ForEach-Object { Write-Host $_ }
|
Get-Content $xmlPath | ForEach-Object { Write-Host $_ }
|
||||||
|
|
||||||
[xml]$xml = Get-Content $xmlPath
|
$content = [System.IO.File]::ReadAllText($xmlPath)
|
||||||
$servers = $xml.settings.servers.server
|
$expected = @(
|
||||||
if (($servers[0].id -ne 'maven') -or ($servers[0].username -ne '${env.MAVEN_USERNAME}') -or ($servers[0].password -ne '${env.MAVEN_CENTRAL_TOKEN}')) {
|
'<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"'
|
||||||
throw "Generated XML file is incorrect"
|
' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
|
||||||
}
|
' xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">'
|
||||||
|
' <interactiveMode>false</interactiveMode>'
|
||||||
|
' <servers>'
|
||||||
|
' <server>'
|
||||||
|
' <id>maven</id>'
|
||||||
|
' <username>${env.MAVEN_USERNAME}</username>'
|
||||||
|
' <password>${env.MAVEN_CENTRAL_TOKEN}</password>'
|
||||||
|
' </server>'
|
||||||
|
' </servers>'
|
||||||
|
'</settings>'
|
||||||
|
) -join "`n"
|
||||||
|
|
||||||
if (($servers[1].id -ne 'gpg.passphrase') -or ($servers[1].passphrase -ne '${env.MAVEN_GPG_PASSPHRASE}')) {
|
if ($content -ne $expected) {
|
||||||
|
Write-Host "Expected settings.xml:"
|
||||||
|
$expected -split "`n" | ForEach-Object { Write-Host $_ }
|
||||||
throw "Generated XML file is incorrect"
|
throw "Generated XML file is incorrect"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ jobs:
|
|||||||
'dragonwell',
|
'dragonwell',
|
||||||
'sapmachine',
|
'sapmachine',
|
||||||
'jetbrains',
|
'jetbrains',
|
||||||
'kona'
|
'kona',
|
||||||
|
'liberica-nik'
|
||||||
] # internally 'adopt-hotspot' is the same as 'adopt'
|
] # internally 'adopt-hotspot' is the same as 'adopt'
|
||||||
version: ['21', '11', '17']
|
version: ['21', '11', '17']
|
||||||
exclude:
|
exclude:
|
||||||
@@ -55,6 +56,24 @@ jobs:
|
|||||||
- distribution: microsoft
|
- distribution: microsoft
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
version: 25
|
version: 25
|
||||||
|
- distribution: kona
|
||||||
|
os: windows-latest
|
||||||
|
version: 25
|
||||||
|
- distribution: kona
|
||||||
|
os: ubuntu-latest
|
||||||
|
version: 25
|
||||||
|
- distribution: kona
|
||||||
|
os: macos-latest
|
||||||
|
version: 25
|
||||||
|
- distribution: liberica-nik
|
||||||
|
os: windows-latest
|
||||||
|
version: 25
|
||||||
|
- distribution: liberica-nik
|
||||||
|
os: ubuntu-latest
|
||||||
|
version: 25
|
||||||
|
- distribution: liberica-nik
|
||||||
|
os: macos-latest
|
||||||
|
version: 25
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: macos-15-intel
|
os: macos-15-intel
|
||||||
version: 17
|
version: 17
|
||||||
@@ -77,7 +96,8 @@ jobs:
|
|||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: '24-ea'
|
version: '24-ea'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- &checkout_step
|
||||||
|
name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
@@ -108,10 +128,7 @@ jobs:
|
|||||||
distribution: ['temurin', 'sapmachine']
|
distribution: ['temurin', 'sapmachine']
|
||||||
version: ['21', '17']
|
version: ['21', '17']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Install bash
|
- name: Install bash
|
||||||
run: apk add --no-cache bash
|
run: apk add --no-cache bash
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
@@ -134,7 +151,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: &default_os [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['temurin', 'zulu', 'liberica']
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
version:
|
version:
|
||||||
- '11.0'
|
- '11.0'
|
||||||
@@ -163,10 +180,7 @@ jobs:
|
|||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: '17.0.7'
|
version: '17.0.7'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@@ -188,7 +202,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: *default_os
|
||||||
distribution:
|
distribution:
|
||||||
[
|
[
|
||||||
'temurin',
|
'temurin',
|
||||||
@@ -202,10 +216,7 @@ jobs:
|
|||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@@ -228,7 +239,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: *default_os
|
||||||
distribution:
|
distribution:
|
||||||
[
|
[
|
||||||
'temurin',
|
'temurin',
|
||||||
@@ -242,10 +253,7 @@ jobs:
|
|||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@@ -275,26 +283,37 @@ jobs:
|
|||||||
run: bash __tests__/verify-java.sh "17" "$JAVA_PATH"
|
run: bash __tests__/verify-java.sh "17" "$JAVA_PATH"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
setup-java-ea-versions-zulu:
|
setup-java-ea-versions:
|
||||||
name: zulu ${{ matrix.version }} (jdk-${{ contains(matrix.os, 'macos') && !contains(matrix.os, 'intel') && 'arm64' || 'x64' }}) - ${{ matrix.os }}
|
name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-${{ contains(matrix.os, 'macos') && !contains(matrix.os, 'intel') && 'arm64' || 'x64' }}) - ${{ matrix.os }}
|
||||||
needs: setup-java-major-minor-versions
|
needs: setup-java-major-minor-versions
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
include:
|
||||||
version: ['17-ea', '15.0.0-ea.14']
|
- {os: macos-15-intel, version: '17-ea', distribution: zulu}
|
||||||
|
- {os: windows-latest, version: '17-ea', distribution: zulu}
|
||||||
|
- {os: ubuntu-latest, version: '17-ea', distribution: zulu}
|
||||||
|
- {os: macos-15-intel, version: '15.0.0-ea.14', distribution: zulu}
|
||||||
|
- {os: windows-latest, version: '15.0.0-ea.14', distribution: zulu}
|
||||||
|
- {os: ubuntu-latest, version: '15.0.0-ea.14', distribution: zulu}
|
||||||
|
- {os: macos-latest, version: '17-ea', distribution: temurin}
|
||||||
|
- {os: windows-latest, version: '17-ea', distribution: temurin}
|
||||||
|
- {os: ubuntu-latest, version: '17-ea', distribution: temurin}
|
||||||
|
- {os: macos-latest, version: '17-ea', distribution: sapmachine}
|
||||||
|
- {os: windows-latest, version: '17-ea', distribution: sapmachine}
|
||||||
|
- {os: ubuntu-latest, version: '17-ea', distribution: sapmachine}
|
||||||
|
- {os: macos-latest, version: '21-ea', distribution: sapmachine}
|
||||||
|
- {os: windows-latest, version: '21-ea', distribution: sapmachine}
|
||||||
|
- {os: ubuntu-latest, version: '21-ea', distribution: sapmachine}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.version }}
|
java-version: ${{ matrix.version }}
|
||||||
distribution: zulu
|
distribution: ${{ matrix.distribution }}
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
env:
|
env:
|
||||||
JAVA_VERSION: ${{ matrix.version }}
|
JAVA_VERSION: ${{ matrix.version }}
|
||||||
@@ -302,53 +321,24 @@ jobs:
|
|||||||
run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
|
run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
setup-java-ea-versions-temurin:
|
setup-java-signature-verification:
|
||||||
name: temurin ${{ matrix.version }} (jdk-${{ contains(matrix.os, 'macos') && !contains(matrix.os, 'intel') && 'arm64' || 'x64' }}) - ${{ matrix.os }}
|
name: ${{ matrix.distribution }} ${{ matrix.version }} signature verification - ${{ matrix.os }}
|
||||||
needs: setup-java-major-minor-versions
|
needs: setup-java-major-minor-versions
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: *default_os
|
||||||
version: ['17-ea']
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java
|
|
||||||
uses: ./
|
|
||||||
id: setup-java
|
|
||||||
with:
|
|
||||||
java-version: ${{ matrix.version }}
|
|
||||||
distribution: temurin
|
|
||||||
- name: Verify Java
|
|
||||||
env:
|
|
||||||
JAVA_VERSION: ${{ matrix.version }}
|
|
||||||
JAVA_PATH: ${{ steps.setup-java.outputs.path }}
|
|
||||||
run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
setup-java-temurin-signature-verification:
|
|
||||||
name: temurin ${{ matrix.version }} signature verification - ${{ matrix.os }}
|
|
||||||
needs: setup-java-major-minor-versions
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
||||||
version: ['21', '17']
|
version: ['21', '17']
|
||||||
|
distribution: [temurin, microsoft]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java with signature verification
|
- name: setup-java with signature verification
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.version }}
|
java-version: ${{ matrix.version }}
|
||||||
distribution: temurin
|
distribution: ${{ matrix.distribution }}
|
||||||
verify-signature: true
|
verify-signature: true
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
env:
|
env:
|
||||||
@@ -357,61 +347,6 @@ jobs:
|
|||||||
run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
|
run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
setup-java-microsoft-signature-verification:
|
|
||||||
name: microsoft ${{ matrix.version }} signature verification - ${{ matrix.os }}
|
|
||||||
needs: setup-java-major-minor-versions
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
||||||
version: ['21', '17']
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java with signature verification
|
|
||||||
uses: ./
|
|
||||||
id: setup-java
|
|
||||||
with:
|
|
||||||
java-version: ${{ matrix.version }}
|
|
||||||
distribution: microsoft
|
|
||||||
verify-signature: true
|
|
||||||
- name: Verify Java
|
|
||||||
env:
|
|
||||||
JAVA_VERSION: ${{ matrix.version }}
|
|
||||||
JAVA_PATH: ${{ steps.setup-java.outputs.path }}
|
|
||||||
run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
setup-java-ea-versions-sapmachine:
|
|
||||||
name: sapmachine ${{ matrix.version }} (jdk-${{ contains(matrix.os, 'macos') && !contains(matrix.os, 'intel') && 'arm64' || 'x64' }}) - ${{ matrix.os }}
|
|
||||||
needs: setup-java-major-minor-versions
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
||||||
version: ['17-ea', '21-ea']
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java
|
|
||||||
uses: ./
|
|
||||||
id: setup-java
|
|
||||||
with:
|
|
||||||
java-version: ${{ matrix.version }}
|
|
||||||
distribution: sapmachine
|
|
||||||
- name: Verify Java
|
|
||||||
env:
|
|
||||||
JAVA_VERSION: ${{ matrix.version }}
|
|
||||||
JAVA_PATH: ${{ steps.setup-java.outputs.path }}
|
|
||||||
run: bash __tests__/verify-java.sh "$JAVA_VERSION" "$JAVA_PATH"
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
setup-java-custom-package-type:
|
setup-java-custom-package-type:
|
||||||
name: ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}-x64) - ${{ matrix.os }}
|
name: ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}-x64) - ${{ matrix.os }}
|
||||||
needs: setup-java-major-minor-versions
|
needs: setup-java-major-minor-versions
|
||||||
@@ -441,6 +376,10 @@ jobs:
|
|||||||
java-package: jre+fx
|
java-package: jre+fx
|
||||||
version: '11'
|
version: '11'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
- distribution: 'liberica-nik'
|
||||||
|
java-package: jdk+fx
|
||||||
|
version: '21'
|
||||||
|
os: ubuntu-latest
|
||||||
- distribution: 'corretto'
|
- distribution: 'corretto'
|
||||||
java-package: jre
|
java-package: jre
|
||||||
version: '8'
|
version: '8'
|
||||||
@@ -487,10 +426,7 @@ jobs:
|
|||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@@ -520,10 +456,7 @@ jobs:
|
|||||||
distribution: ['liberica', 'zulu', 'corretto']
|
distribution: ['liberica', 'zulu', 'corretto']
|
||||||
version: ['11']
|
version: ['11']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@@ -544,14 +477,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: *default_os
|
||||||
distribution: ['temurin', 'microsoft', 'corretto']
|
distribution: ['temurin', 'microsoft', 'corretto']
|
||||||
java-version-file: ['.java-version', '.tool-versions']
|
java-version-file: ['.java-version', '.tool-versions']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "17" > .java-version
|
run: echo "17" > .java-version
|
||||||
@@ -577,14 +507,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: *default_os
|
||||||
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto']
|
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto']
|
||||||
java-version-file: ['.java-version', '.tool-versions']
|
java-version-file: ['.java-version', '.tool-versions']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "11" > .java-version
|
run: echo "11" > .java-version
|
||||||
@@ -609,14 +536,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: *default_os
|
||||||
distribution: ['adopt', 'adopt-openj9', 'zulu']
|
distribution: ['adopt', 'adopt-openj9', 'zulu']
|
||||||
java-version-file: ['.java-version', '.tool-versions']
|
java-version-file: ['.java-version', '.tool-versions']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- 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
|
||||||
@@ -641,14 +565,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: *default_os
|
||||||
distribution: ['adopt', 'zulu', 'liberica']
|
distribution: ['adopt', 'zulu', 'liberica']
|
||||||
java-version-file: ['.java-version', '.tool-versions', '.sdkmanrc']
|
java-version-file: ['.java-version', '.tool-versions', '.sdkmanrc']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v7
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- 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
|
||||||
@@ -677,10 +598,9 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: *default_os
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- *checkout_step
|
||||||
uses: actions/checkout@v6
|
|
||||||
- name: Setup Java 17 as default
|
- name: Setup Java 17 as default
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java-17
|
id: setup-java-17
|
||||||
@@ -699,10 +619,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Verify JAVA_HOME still points to Java 17
|
- name: Verify JAVA_HOME still points to Java 17
|
||||||
|
env:
|
||||||
|
JAVA_17_PATH: ${{ steps.setup-java-17.outputs.path }}
|
||||||
run: |
|
run: |
|
||||||
echo "JAVA_HOME=$JAVA_HOME"
|
echo "JAVA_HOME=$JAVA_HOME"
|
||||||
echo "Java 17 path=${{ steps.setup-java-17.outputs.path }}"
|
echo "Java 17 path=$JAVA_17_PATH"
|
||||||
if [ "$JAVA_HOME" != "${{ steps.setup-java-17.outputs.path }}" ]; then
|
if [ "$JAVA_HOME" != "$JAVA_17_PATH" ]; then
|
||||||
echo "JAVA_HOME should still point to Java 17"
|
echo "JAVA_HOME should still point to Java 17"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -731,14 +653,17 @@ jobs:
|
|||||||
Write-Host "$envName=$JavaVersionPath"
|
Write-Host "$envName=$JavaVersionPath"
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
- name: Verify Java 21 outputs are set
|
- name: Verify Java 21 outputs are set
|
||||||
|
env:
|
||||||
|
JAVA_21_PATH: ${{ steps.setup-java-21.outputs.path }}
|
||||||
|
JAVA_21_VERSION: ${{ steps.setup-java-21.outputs.version }}
|
||||||
run: |
|
run: |
|
||||||
echo "Java 21 path=${{ steps.setup-java-21.outputs.path }}"
|
echo "Java 21 path=$JAVA_21_PATH"
|
||||||
echo "Java 21 version=${{ steps.setup-java-21.outputs.version }}"
|
echo "Java 21 version=$JAVA_21_VERSION"
|
||||||
if [ -z "${{ steps.setup-java-21.outputs.path }}" ]; then
|
if [ -z "$JAVA_21_PATH" ]; then
|
||||||
echo "Java 21 path output should be set"
|
echo "Java 21 path output should be set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ -z "${{ steps.setup-java-21.outputs.version }}" ]; then
|
if [ -z "$JAVA_21_VERSION" ]; then
|
||||||
echo "Java 21 version output should be set"
|
echo "Java 21 version output should be set"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ allowed:
|
|||||||
- mit
|
- mit
|
||||||
- cc0-1.0
|
- cc0-1.0
|
||||||
- unlicense
|
- unlicense
|
||||||
|
- blueoak-1.0.0
|
||||||
|
|
||||||
reviewed:
|
reviewed:
|
||||||
npm:
|
npm:
|
||||||
- "@actions/http-client" # MIT (license text present), but detected as "other"
|
- "@actions/http-client" # MIT (license text present), but detected as "other"
|
||||||
- "argparse" # Python Software Foundation License (PSF), but detected as "other"
|
- "argparse" # Python Software Foundation License (PSF), but detected as "other"
|
||||||
|
- "balanced-match"
|
||||||
|
- "brace-expansion"
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/cache"
|
name: "@actions/cache"
|
||||||
version: 5.1.0
|
version: 6.2.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions cache lib
|
summary: Actions cache lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/core"
|
name: "@actions/core"
|
||||||
version: 2.0.3
|
version: 3.0.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions core lib
|
summary: Actions core lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/exec"
|
name: "@actions/exec"
|
||||||
version: 2.0.0
|
version: 3.0.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions exec lib
|
summary: Actions exec lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
|
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/glob"
|
name: "@actions/glob"
|
||||||
version: 0.5.1
|
version: 0.6.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions glob lib
|
summary: Actions glob lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/glob
|
homepage: https://github.com/actions/toolkit/tree/main/packages/glob
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: "@actions/glob"
|
||||||
|
version: 0.7.0
|
||||||
|
type: npm
|
||||||
|
summary: Actions glob lib
|
||||||
|
homepage: https://github.com/actions/toolkit/tree/main/packages/glob
|
||||||
|
license: mit
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE.md
|
||||||
|
text: |-
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright 2019 GitHub
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
notices: []
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/http-client"
|
name: "@actions/http-client"
|
||||||
version: 3.0.2
|
version: 4.0.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions Http Client
|
summary: Actions Http Client
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
|
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/io"
|
name: "@actions/io"
|
||||||
version: 2.0.0
|
version: 3.0.2
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions io lib
|
summary: Actions io lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/io
|
homepage: https://github.com/actions/toolkit/tree/main/packages/io
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/tool-cache"
|
name: "@actions/tool-cache"
|
||||||
version: 3.0.1
|
version: 4.0.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions tool-cache lib
|
summary: Actions tool-cache lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache
|
homepage: https://github.com/actions/toolkit/tree/main/packages/tool-cache
|
||||||
|
|||||||
Generated
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/core-client"
|
name: "@azure/core-client"
|
||||||
version: 1.10.1
|
version: 1.10.2
|
||||||
type: npm
|
type: npm
|
||||||
summary: Core library for interfacing with AutoRest generated code
|
summary: Core library for interfacing with AutoRest generated code
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client/
|
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-client/
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/core-http-compat"
|
name: "@azure/core-http-compat"
|
||||||
version: 2.3.1
|
version: 2.4.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Core HTTP Compatibility Library to bridge the gap between Core V1 & V2 packages.
|
summary: Core HTTP Compatibility Library to bridge the gap between Core V1 & V2 packages.
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-compat/
|
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-compat/
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/core-rest-pipeline"
|
name: "@azure/core-rest-pipeline"
|
||||||
version: 1.22.2
|
version: 1.24.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Isomorphic client library for making HTTP requests in node.js and browser.
|
summary: Isomorphic client library for making HTTP requests in node.js and browser.
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-rest-pipeline/
|
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-rest-pipeline/README.md
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/core-xml"
|
name: "@azure/core-xml"
|
||||||
version: 1.5.0
|
version: 1.5.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Core library for interacting with XML payloads
|
summary: Core library for interacting with XML payloads
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-xml/
|
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-xml/
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/storage-blob"
|
name: "@azure/storage-blob"
|
||||||
version: 12.29.1
|
version: 12.33.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Microsoft Azure Storage SDK for JavaScript - Blob
|
summary: Microsoft Azure Storage SDK for JavaScript - Blob
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
|
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-blob/README.md
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/storage-common"
|
name: "@azure/storage-common"
|
||||||
version: 12.1.1
|
version: 12.4.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Azure Storage Common Client Library for JavaScript
|
summary: Azure Storage Common Client Library for JavaScript
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-internal-avro/
|
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/storage/storage-common/README.md
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@typespec/ts-http-runtime"
|
name: "@typespec/ts-http-runtime"
|
||||||
version: 0.3.2
|
version: 0.3.6
|
||||||
type: npm
|
type: npm
|
||||||
summary: Isomorphic client library for making HTTP requests in node.js and browser.
|
summary: Isomorphic client library for making HTTP requests in node.js and browser.
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/ts-http-runtime/
|
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/ts-http-runtime/README.md
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
|||||||
Generated
+3
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: anynum
|
name: anynum
|
||||||
version: 1.0.0
|
version: 1.0.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Normalize all Unicode decimal digits (Devanagari, Arabic, Thai, etc.) to
|
summary: Normalize all Unicode decimal digits (Devanagari, Arabic, Thai, etc.) to
|
||||||
ASCII numerals. Zero dependencies, performance-first.
|
ASCII numerals. Zero dependencies, performance-first.
|
||||||
@@ -30,4 +30,6 @@ licenses:
|
|||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
- sources: README.md
|
||||||
|
text: MIT
|
||||||
notices: []
|
notices: []
|
||||||
|
|||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
name: balanced-match
|
||||||
|
version: 4.0.4
|
||||||
|
type: npm
|
||||||
|
summary: Match balanced character pairs, like "{" and "}"
|
||||||
|
homepage:
|
||||||
|
license: other
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE.md
|
||||||
|
text: |
|
||||||
|
(MIT)
|
||||||
|
|
||||||
|
Original code Copyright Julian Gruber <julian@juliangruber.com>
|
||||||
|
|
||||||
|
Port to TypeScript Copyright Isaac Z. Schlueter <i@izs.me>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the "Software"), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
||||||
|
so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
notices: []
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: brace-expansion
|
name: brace-expansion
|
||||||
version: 1.1.13
|
version: 1.1.15
|
||||||
type: npm
|
type: npm
|
||||||
summary: Brace expansion as known from sh/bash
|
summary: Brace expansion as known from sh/bash
|
||||||
homepage: https://github.com/juliangruber/brace-expansion
|
homepage: https://github.com/juliangruber/brace-expansion
|
||||||
+34
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
name: brace-expansion
|
||||||
|
version: 5.0.7
|
||||||
|
type: npm
|
||||||
|
summary: Brace expansion as known from sh/bash
|
||||||
|
homepage:
|
||||||
|
license: other
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: |
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright Julian Gruber <julian@juliangruber.com>
|
||||||
|
|
||||||
|
TypeScript port Copyright Isaac Z. Schlueter <i@izs.me>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
notices: []
|
||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: fast-xml-builder
|
name: fast-xml-builder
|
||||||
version: 1.2.0
|
version: 1.2.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Build XML from JSON without C/C++ based libraries
|
summary: Build XML from JSON without C/C++ based libraries
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: fast-xml-parser
|
name: fast-xml-parser
|
||||||
version: 5.8.0
|
version: 5.9.3
|
||||||
type: npm
|
type: npm
|
||||||
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
|
summary: Validate XML, Parse XML, Build XML without C/C++ based libraries
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
+9
-6
@@ -1,16 +1,17 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/abort-controller"
|
name: is-unsafe
|
||||||
version: 1.1.0
|
version: 1.0.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Microsoft Azure SDK for JavaScript - Aborter
|
summary: Zero-dependency, DOM-free, pure predicate for detecting unsafe strings across
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md
|
HTML, XML, SVG, SQL, SHELL, and REGEX contexts
|
||||||
|
homepage:
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
text: |
|
text: |
|
||||||
The MIT License (MIT)
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2020 Microsoft
|
Copyright (c) 2026 Natural Intelligence
|
||||||
|
|
||||||
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
|
||||||
@@ -29,4 +30,6 @@ licenses:
|
|||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
- sources: README.md
|
||||||
|
text: MIT
|
||||||
notices: []
|
notices: []
|
||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: js-yaml
|
name: js-yaml
|
||||||
version: 4.1.1
|
version: 4.3.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: YAML 1.2 parser and serializer
|
summary: YAML 1.2 parser and serializer
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
Generated
+66
@@ -0,0 +1,66 @@
|
|||||||
|
---
|
||||||
|
name: minimatch
|
||||||
|
version: 10.2.5
|
||||||
|
type: npm
|
||||||
|
summary: a glob matcher in javascript
|
||||||
|
homepage:
|
||||||
|
license: blueoak-1.0.0
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE.md
|
||||||
|
text: |
|
||||||
|
# Blue Oak Model License
|
||||||
|
|
||||||
|
Version 1.0.0
|
||||||
|
|
||||||
|
## Purpose
|
||||||
|
|
||||||
|
This license gives everyone as much permission to work with
|
||||||
|
this software as possible, while protecting contributors
|
||||||
|
from liability.
|
||||||
|
|
||||||
|
## Acceptance
|
||||||
|
|
||||||
|
In order to receive this license, you must agree to its
|
||||||
|
rules. The rules of this license are both obligations
|
||||||
|
under that agreement and conditions to your license.
|
||||||
|
You must not do anything with this software that triggers
|
||||||
|
a rule that you cannot or will not follow.
|
||||||
|
|
||||||
|
## Copyright
|
||||||
|
|
||||||
|
Each contributor licenses you to do everything with this
|
||||||
|
software that would otherwise infringe that contributor's
|
||||||
|
copyright in it.
|
||||||
|
|
||||||
|
## Notices
|
||||||
|
|
||||||
|
You must ensure that everyone who gets a copy of
|
||||||
|
any part of this software from you, with or without
|
||||||
|
changes, also gets the text of this license or a link to
|
||||||
|
<https://blueoakcouncil.org/license/1.0.0>.
|
||||||
|
|
||||||
|
## Excuse
|
||||||
|
|
||||||
|
If anyone notifies you in writing that you have not
|
||||||
|
complied with [Notices](#notices), you can keep your
|
||||||
|
license by taking all practical steps to comply within 30
|
||||||
|
days after the notice. If you do not do so, your license
|
||||||
|
ends immediately.
|
||||||
|
|
||||||
|
## Patent
|
||||||
|
|
||||||
|
Each contributor licenses you to do everything with this
|
||||||
|
software that would otherwise infringe any patent claims
|
||||||
|
they can license or become able to license.
|
||||||
|
|
||||||
|
## Reliability
|
||||||
|
|
||||||
|
No contributor can revoke this license.
|
||||||
|
|
||||||
|
## No Liability
|
||||||
|
|
||||||
|
**_As far as the law allows, this software comes as is,
|
||||||
|
without any warranty or condition, and no contributor
|
||||||
|
will be liable to anyone for any damages related to this
|
||||||
|
software or this license, under any kind of legal claim._**
|
||||||
|
notices: []
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: path-expression-matcher
|
name: path-expression-matcher
|
||||||
version: 1.5.0
|
version: 1.6.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Efficient path tracking and pattern matching for XML/JSON parsers
|
summary: Efficient path tracking and pattern matching for XML/JSON parsers
|
||||||
homepage: https://github.com/NaturalIntelligence/path-expression-matcher#readme
|
homepage: https://github.com/NaturalIntelligence/path-expression-matcher#readme
|
||||||
|
|||||||
Generated
-26
@@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
name: semver
|
|
||||||
version: 6.3.1
|
|
||||||
type: npm
|
|
||||||
summary: The semantic version parser used by npm.
|
|
||||||
homepage:
|
|
||||||
license: isc
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
notices: []
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: semver
|
name: semver
|
||||||
version: 7.8.4
|
version: 7.8.5
|
||||||
type: npm
|
type: npm
|
||||||
summary: The semantic version parser used by npm.
|
summary: The semantic version parser used by npm.
|
||||||
homepage:
|
homepage:
|
||||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: strnum
|
name: strnum
|
||||||
version: 2.4.0
|
version: 2.4.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Parse String to Number based on configuration
|
summary: Parse String to Number based on configuration
|
||||||
homepage:
|
homepage:
|
||||||
|
|||||||
@@ -1,11 +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.
|
|
||||||
module.exports = {
|
|
||||||
printWidth: 80,
|
|
||||||
tabWidth: 2,
|
|
||||||
useTabs: false,
|
|
||||||
semi: true,
|
|
||||||
singleQuote: true,
|
|
||||||
trailingComma: 'none',
|
|
||||||
bracketSpacing: false,
|
|
||||||
arrowParens: 'avoid'
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 80,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"bracketSpacing": false,
|
||||||
|
"arrowParens": "avoid"
|
||||||
|
}
|
||||||
@@ -18,6 +18,19 @@ The `setup-java` action provides the following functionality for GitHub Actions
|
|||||||
|
|
||||||
This action allows you to work with Java and Scala projects.
|
This action allows you to work with Java and Scala projects.
|
||||||
|
|
||||||
|
## What's new in V6
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> V6 is still in development (`main` branch) and is not yet recommended for production workflows.
|
||||||
|
|
||||||
|
- **Migrated to ESM** to enable support for the latest `@actions/*` package versions. This is an internal implementation change only. No changes are required to your workflow configuration, and the action's behavior is unchanged. Existing workflows continue to work as before.
|
||||||
|
|
||||||
|
## Breaking changes in V6
|
||||||
|
|
||||||
|
- **The GPG passphrase is now passed to the Maven GPG Plugin through an environment variable (`gpg.passphraseEnvName`) instead of the deprecated `gpg.passphrase` server in `settings.xml`.** The `gpg-passphrase` input and its default (`GPG_PASSPHRASE`) are unchanged, so if you already set that environment variable in your build step your workflow keeps working. However, this now requires `maven-gpg-plugin` **3.2.0 or newer**; older versions do not honor `gpg.passphraseEnvName` and, because the `gpg.passphrase` server is no longer written, will not pick up the passphrase. Upgrade the plugin to 3.2.0+.
|
||||||
|
|
||||||
|
See [GPG](docs/advanced-usage.md#gpg) for details.
|
||||||
|
|
||||||
## Breaking changes in V5
|
## Breaking changes in V5
|
||||||
|
|
||||||
- Upgraded action from node20 to node24
|
- Upgraded action from node20 to node24
|
||||||
@@ -33,20 +46,24 @@ 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`).
|
- `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`. Default value: `jdk`.
|
- `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`.
|
||||||
|
|
||||||
- `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.
|
- `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.
|
||||||
|
|
||||||
- `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.
|
- `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.)
|
||||||
|
|
||||||
- `check-latest`: Setting this option makes the action to check for the latest available version for the version spec.
|
- `check-latest`: Setting this option makes the action to check for the latest available version for the version spec.
|
||||||
|
|
||||||
- `set-default`: Set to `false` to install a JDK without making it the default. When `false`, `JAVA_HOME` and `PATH` are not updated, but `JAVA_HOME_<major>_<arch>` is still set so the JDK remains discoverable. Default value: `true`. See [Installing JDK without setting as default](docs/advanced-usage.md#Installing-JDK-without-setting-as-default) for more details.
|
- `set-default`: Set to `false` to install a JDK without making it the default. When `false`, `JAVA_HOME` and `PATH` are not updated, but `JAVA_HOME_<major>_<arch>` is still set so the JDK remains discoverable. Default value: `true`. See [Installing JDK without setting as default](docs/advanced-usage.md#Installing-JDK-without-setting-as-default) for more details.
|
||||||
|
|
||||||
|
- `problem-matcher`: Set to `false` to disable Java problem matcher annotations (compiler diagnostics and uncaught exceptions). Default value: `true`. See [Java problem matcher](docs/advanced-usage.md#java-problem-matcher-compiler-annotations) for details and annotation limits.
|
||||||
|
|
||||||
- `verify-signature`: Verifies downloaded Java package signatures when supported by the selected distribution. Currently supported for `temurin` and `microsoft`. If set to `true` for unsupported distributions, the action fails.
|
- `verify-signature`: Verifies downloaded Java package signatures when supported by the selected distribution. Currently supported for `temurin` and `microsoft`. If set to `true` for unsupported distributions, the action fails.
|
||||||
|
|
||||||
- `verify-signature-public-key`: ASCII-armored GPG public key used to verify the downloaded package signature. Overrides the default bundled key for the selected distribution.
|
- `verify-signature-public-key`: ASCII-armored GPG public key used to verify the downloaded package signature. Overrides the default bundled key for the selected distribution.
|
||||||
|
|
||||||
|
- `token`: The token used to authenticate when fetching version manifests hosted on GitHub.com. Defaults to `${{ github.token }}` when running on GitHub.com; defaults to an empty string on GitHub Enterprise Server. On GHES, provide a GitHub.com personal access token if manifest requests are rate-limited. See [Using Microsoft distribution on GHES](docs/advanced-usage.md#using-microsoft-distribution-on-ghes) for more details.
|
||||||
|
|
||||||
- `cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predefined package managers. It can be one of "maven", "gradle" or "sbt".
|
- `cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predefined package managers. It can be one of "maven", "gradle" or "sbt".
|
||||||
|
|
||||||
- `cache-dependency-path`: The path to a dependency file: pom.xml, build.gradle, build.sbt, etc. This option can be used with the `cache` option. If this option is omitted, the action searches for the dependency file in the entire repository. This option supports wildcards and a list of file names for caching multiple dependencies.
|
- `cache-dependency-path`: The path to a dependency file: pom.xml, build.gradle, build.sbt, etc. This option can be used with the `cache` option. If this option is omitted, the action searches for the dependency file in the entire repository. This option supports wildcards and a list of file names for caching multiple dependencies.
|
||||||
@@ -58,49 +75,60 @@ For more details, see the full release notes on the [releases page](https://git
|
|||||||
|
|
||||||
- `server-id`: ID of the distributionManagement repository in the pom.xml file. Default is `github`.
|
- `server-id`: ID of the distributionManagement repository in the pom.xml file. Default is `github`.
|
||||||
|
|
||||||
- `server-username`: Environment variable name for the username for authentication to the Apache Maven repository. Default is GITHUB_ACTOR.
|
- `server-username`: Environment variable name for the username for authentication to the Apache Maven repository. Default is GITHUB\_ACTOR.
|
||||||
|
|
||||||
- `server-password`: Environment variable name for password or token for authentication to the Apache Maven repository. Default is GITHUB_TOKEN.
|
- `server-password`: Environment variable name for password or token for authentication to the Apache Maven repository. Default is GITHUB\_TOKEN.
|
||||||
|
|
||||||
- `settings-path`: Maven related setting to point to the directory where the settings.xml file will be written. Default is ~/.m2.
|
- `settings-path`: Maven related setting to point to the directory where the settings.xml file will be written. Default is \~/.m2.
|
||||||
|
|
||||||
- `gpg-private-key`: GPG private key to import. Default is empty string.
|
- `gpg-private-key`: GPG private key to import. Default is empty string.
|
||||||
|
|
||||||
- `gpg-passphrase`: Environment variable name for the GPG private key passphrase. Default is GPG_PASSPHRASE.
|
- `gpg-passphrase`: Environment variable name for the GPG private key passphrase. Default is GPG\_PASSPHRASE.
|
||||||
|
|
||||||
- `mvn-toolchain-id`: Name of Maven Toolchain ID if the default name of `${distribution}_${java-version}` is not wanted.
|
- `mvn-toolchain-id`: Name of Maven Toolchain ID if the default name of `${distribution}_${java-version}` is not wanted.
|
||||||
|
|
||||||
- `mvn-toolchain-vendor`: Name of Maven Toolchain Vendor if the default name of `${distribution}` is not wanted.
|
- `mvn-toolchain-vendor`: Name of Maven Toolchain Vendor if the default name of `${distribution}` is not wanted.
|
||||||
|
|
||||||
|
- `show-download-progress`: Set to `true` to keep Maven artifact download and transfer progress in build logs. Default value: `false`. By default, the action adds `-ntp` (`--no-transfer-progress`) to `MAVEN_ARGS`. This input has no effect on non-Maven builds. See [Maven transfer progress](docs/advanced-usage.md#maven-transfer-progress-download-logs) for more details.
|
||||||
|
|
||||||
### Basic Configuration
|
### Basic Configuration
|
||||||
|
|
||||||
#### Eclipse Temurin
|
#### Eclipse Temurin
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin' # See 'Supported distributions' for available options
|
distribution: 'temurin' # See 'Supported distributions' for available options
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Azul Zulu OpenJDK
|
#### Azul Zulu OpenJDK
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu' # See 'Supported distributions' for available options
|
distribution: 'zulu' # See 'Supported distributions' for available options
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Supported version syntax
|
#### Supported version syntax
|
||||||
The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation. The values below are examples, not an exhaustive list:
|
The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation. The values below are examples, not an exhaustive list:
|
||||||
- major versions, such as: `8`, `11`, `16`, `17`, `21`, `25`
|
- major versions, such as: `8`, `11`, `16`, `17`, `21`, `25`
|
||||||
- more specific versions: `8.0.282+8`, `8.0.232`, `11.0`, `11.0.4`, `17.0`
|
- more specific versions: `8.0.282+8`, `8.0.232`, `11.0`, `11.0.4`, `17.0`
|
||||||
|
- multi-field Java versions (JEP 322), such as: `11.0.9.1`, `18.0.1.1`
|
||||||
- early access (EA) versions: `15-ea`, `15.0.0-ea`
|
- early access (EA) versions: `15-ea`, `15.0.0-ea`
|
||||||
|
- the `latest` alias, which floats to the newest available stable (GA) release
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> - `latest` always resolves the newest version from the distribution's remote metadata (it behaves like `check-latest: true`), so it ignores any older version already present in the runner tool cache. This has the same performance trade-off described in [Check latest](#check-latest).
|
||||||
|
> - `latest` is only supported through the `java-version` input, not through `java-version-file`, and it resolves stable (GA) releases only — it cannot be combined with `-ea`.
|
||||||
|
> - The `jdkfile` distribution does not support `latest`, as it installs from a local file.
|
||||||
|
> - For `oracle` and `graalvm` (Oracle GraalVM), `latest` uses the Adoptium API only to determine the newest GA **major version number** — the JDK binary itself is still downloaded from the Oracle / GraalVM servers for that major. Because these distributions have no endpoint to list their own releases, if their servers haven't published the resolved major yet, the action fails and asks you to specify a concrete version. Note the Oracle JDK license caveat below still applies to a floating `latest`.
|
||||||
|
> - For `graalvm-community`, `latest` floats to the newest GA release published on GitHub, so it never depends on the Adoptium API and always resolves to the newest major that GraalVM Community actually ships.
|
||||||
|
|
||||||
#### Supported distributions
|
#### Supported distributions
|
||||||
Currently, the following distributions are supported:
|
Currently, the following distributions are supported:
|
||||||
@@ -111,6 +139,7 @@ Currently, the following distributions are supported:
|
|||||||
| `adopt` or `adopt-hotspot` | [AdoptOpenJDK Hotspot](https://adoptopenjdk.net/) | [`adopt-hotspot` license](https://adoptopenjdk.net/about.html) |
|
| `adopt` or `adopt-hotspot` | [AdoptOpenJDK Hotspot](https://adoptopenjdk.net/) | [`adopt-hotspot` license](https://adoptopenjdk.net/about.html) |
|
||||||
| `adopt-openj9` | [AdoptOpenJDK OpenJ9](https://adoptopenjdk.net/) | [`adopt-openj9` license](https://adoptopenjdk.net/about.html) |
|
| `adopt-openj9` | [AdoptOpenJDK OpenJ9](https://adoptopenjdk.net/) | [`adopt-openj9` license](https://adoptopenjdk.net/about.html) |
|
||||||
| `liberica` | [Liberica JDK](https://bell-sw.com/) | [`liberica` license](https://bell-sw.com/liberica_eula/) |
|
| `liberica` | [Liberica JDK](https://bell-sw.com/) | [`liberica` license](https://bell-sw.com/liberica_eula/) |
|
||||||
|
| `liberica-nik` | [Liberica Native Image Kit](https://bell-sw.com/pages/downloads/native-image-kit/) | [`liberica-nik` license](https://bell-sw.com/liberica_nik_eula/) |
|
||||||
| `microsoft` | [Microsoft Build of OpenJDK](https://www.microsoft.com/openjdk) | [`microsoft` license](https://docs.microsoft.com/java/openjdk/faq)
|
| `microsoft` | [Microsoft Build of OpenJDK](https://www.microsoft.com/openjdk) | [`microsoft` license](https://docs.microsoft.com/java/openjdk/faq)
|
||||||
| `corretto` | [Amazon Corretto Build of OpenJDK](https://aws.amazon.com/corretto/) | [`corretto` license](https://aws.amazon.com/corretto/faqs/)
|
| `corretto` | [Amazon Corretto Build of OpenJDK](https://aws.amazon.com/corretto/) | [`corretto` license](https://aws.amazon.com/corretto/faqs/)
|
||||||
| `semeru` | [IBM Semeru Runtime Open Edition](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/) | [`semeru` license](https://openjdk.java.net/legal/gplv2+ce.html) |
|
| `semeru` | [IBM Semeru Runtime Open Edition](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/) | [`semeru` license](https://openjdk.java.net/legal/gplv2+ce.html) |
|
||||||
@@ -126,7 +155,7 @@ Currently, the following distributions are supported:
|
|||||||
> [!NOTE]
|
> [!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.
|
> - 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/).
|
> - 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 architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
|
> - For Azul Zulu OpenJDK, architecture `arm64` is mapped to `aarch64` when querying the Azul Metadata API.
|
||||||
> - 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.
|
> - 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.
|
> - GraalVM Community is available as `distribution: 'graalvm-community'` for stable JDK 17 and later releases published on GitHub.
|
||||||
|
|
||||||
@@ -138,22 +167,24 @@ 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:
|
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`
|
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, and `**/versions.properties`
|
||||||
- maven: `**/pom.xml` and `**/.mvn/wrapper/maven-wrapper.properties`
|
- maven: `**/pom.xml`, `**/.mvn/wrapper/maven-wrapper.properties`, and `**/.mvn/extensions.xml`
|
||||||
- sbt: all sbt build definition files `**/*.sbt`, `**/project/build.properties`, `**/project/**.scala`, `**/project/**.sbt`
|
- 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.
|
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.
|
||||||
|
|
||||||
The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
|
The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
|
||||||
|
|
||||||
|
The workflow output `cache-primary-key` exposes the primary cache key computed by the action for the configured build tool. It is useful for composing with [`actions/cache`](https://github.com/actions/cache) or [`actions/cache/restore`](https://github.com/actions/cache/tree/main/restore) in later steps or dependent jobs that need to reuse the exact same key. It is empty when caching is not enabled or when caching is skipped (for example, when the cache service is unavailable).
|
||||||
|
|
||||||
The cache input is optional, and caching is turned off by default.
|
The cache input is optional, and caching is turned off by default.
|
||||||
|
|
||||||
**Maven Wrapper:** when `cache: 'maven'` is enabled, the action also caches and restores the Maven Wrapper distribution downloaded to `~/.m2/wrapper/dists` (in addition to the local repository), so wrapper-based (`./mvnw`) builds don't re-download the wrapper on every run. This is keyed on `**/.mvn/wrapper/maven-wrapper.properties` as shown above.
|
**Maven Wrapper:** when `cache: 'maven'` is enabled, the action also caches and restores the Maven Wrapper distribution downloaded to `~/.m2/wrapper/dists` (in addition to the local repository), so wrapper-based (`./mvnw`) builds don't re-download the Maven distribution. The wrapper distribution is stored in a **separate** cache entry keyed only on `**/.mvn/wrapper/maven-wrapper.properties`, so it stays cached across the frequent `pom.xml` changes that rotate the main dependency cache key.
|
||||||
|
|
||||||
#### Caching gradle dependencies
|
#### Caching gradle dependencies
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -161,10 +192,12 @@ steps:
|
|||||||
cache-dependency-path: | # optional
|
cache-dependency-path: | # optional
|
||||||
sub-project/*.gradle*
|
sub-project/*.gradle*
|
||||||
sub-project/**/gradle-wrapper.properties
|
sub-project/**/gradle-wrapper.properties
|
||||||
- run: ./gradlew build --no-daemon
|
- run: ./gradlew build --no-daemon
|
||||||
```
|
```
|
||||||
Using the `cache: gradle` provides a simple and effective way to cache Gradle dependencies with minimal configuration.
|
Using the `cache: gradle` provides a simple and effective way to cache Gradle dependencies with minimal configuration.
|
||||||
|
|
||||||
|
**Gradle Wrapper:** when `cache: 'gradle'` is enabled, the action also caches and restores the Gradle Wrapper distribution downloaded to `~/.gradle/wrapper` (in addition to the Gradle caches), so wrapper-based (`./gradlew`) builds don't re-download the Gradle distribution. The wrapper distribution is stored in a **separate** cache entry keyed only on `**/gradle-wrapper.properties`, so it stays cached across the frequent `*.gradle*` changes that rotate the main dependency cache key.
|
||||||
|
|
||||||
For projects that require more advanced `Gradle` caching features, such as caching build outputs, support for Gradle configuration cache, encrypted cache storage, fine-grained cache control (including options to enable or disable the cache, set it to read-only or write-only, perform automated cleanup, and define custom cache rules), or optimized performance for complex CI workflows, consider using [`gradle/actions/setup-gradle`](https://github.com/gradle/actions/tree/main/setup-gradle).
|
For projects that require more advanced `Gradle` caching features, such as caching build outputs, support for Gradle configuration cache, encrypted cache storage, fine-grained cache control (including options to enable or disable the cache, set it to read-only or write-only, perform automated cleanup, and define custom cache rules), or optimized performance for complex CI workflows, consider using [`gradle/actions/setup-gradle`](https://github.com/gradle/actions/tree/main/setup-gradle).
|
||||||
|
|
||||||
For setup details and a comprehensive overview of all available features, visit the [setup-gradle documentation](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md).
|
For setup details and a comprehensive overview of all available features, visit the [setup-gradle documentation](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md).
|
||||||
@@ -172,22 +205,29 @@ For setup details and a comprehensive overview of all available features, visit
|
|||||||
#### Caching maven dependencies
|
#### Caching maven dependencies
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
cache-dependency-path: 'sub-project/pom.xml' # optional
|
cache-dependency-path: 'sub-project/pom.xml' # optional
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn package --file pom.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> Maven resolves plugin dependencies lazily, so a cache created by a "thin" goal
|
||||||
|
> (e.g. `mvn compile`) can be missing plugin dependencies that later
|
||||||
|
> `test`/`verify`/`package` jobs then re-download on every run. See
|
||||||
|
> [Ensuring the Maven cache is complete](docs/advanced-usage.md#ensuring-the-maven-cache-is-complete-plugin-dependencies)
|
||||||
|
> for how to seed a complete cache.
|
||||||
|
|
||||||
#### Caching sbt dependencies
|
#### Caching sbt dependencies
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
@@ -195,7 +235,7 @@ steps:
|
|||||||
cache-dependency-path: | # optional
|
cache-dependency-path: | # optional
|
||||||
sub-project/build.sbt
|
sub-project/build.sbt
|
||||||
sub-project/project/build.properties
|
sub-project/project/build.properties
|
||||||
- name: Build with SBT
|
- name: Build with SBT
|
||||||
run: sbt package
|
run: sbt package
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -206,13 +246,13 @@ Usually, cache gets downloaded in multiple segments of fixed sizes. Sometimes, a
|
|||||||
env:
|
env:
|
||||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
|
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
cache: 'gradle'
|
cache: 'gradle'
|
||||||
- run: ./gradlew build --no-daemon
|
- run: ./gradlew build --no-daemon
|
||||||
```
|
```
|
||||||
|
|
||||||
### Check latest
|
### Check latest
|
||||||
@@ -226,13 +266,13 @@ For Java distributions that are not cached on Hosted images, `check-latest` alwa
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '25'
|
java-version: '25'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Testing against different Java versions
|
### Testing against different Java versions
|
||||||
@@ -245,9 +285,9 @@ jobs:
|
|||||||
java: [ '8', '11', '17', '21', '25' ]
|
java: [ '8', '11', '17', '21', '25' ]
|
||||||
name: Java ${{ matrix.Java }} sample
|
name: Java ${{ matrix.Java }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Setup java
|
- name: Setup java
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
@@ -256,11 +296,11 @@ jobs:
|
|||||||
|
|
||||||
### Install multiple JDKs
|
### Install multiple JDKs
|
||||||
|
|
||||||
All configured Java versions are added to the PATH. The last one added to the PATH (i.e., the last JDK set up by this action) will be used as the default and available globally. Other Java versions can be accessed through environment variables such as 'JAVA_HOME_{{ MAJOR_VERSION }}_{{ ARCHITECTURE }}'. To use a specific Java version, set the JAVA_HOME environment variable accordingly and prepend its bin directory to the PATH to ensure it takes priority during execution.
|
All configured Java versions are added to the PATH. The last one added to the PATH (i.e., the last JDK set up by this action) will be used as the default and available globally. Other Java versions can be accessed through environment variables such as 'JAVA\_HOME\_{{ MAJOR\_VERSION }}\_{{ ARCHITECTURE }}'. To use a specific Java version, set the JAVA\_HOME environment variable accordingly and prepend its bin directory to the PATH to ensure it takes priority during execution.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: |
|
java-version: |
|
||||||
@@ -279,6 +319,7 @@ In the example above multiple JDKs are installed for the same job. The result af
|
|||||||
- [Adopt](docs/advanced-usage.md#Adopt)
|
- [Adopt](docs/advanced-usage.md#Adopt)
|
||||||
- [Zulu](docs/advanced-usage.md#Zulu)
|
- [Zulu](docs/advanced-usage.md#Zulu)
|
||||||
- [Liberica](docs/advanced-usage.md#Liberica)
|
- [Liberica](docs/advanced-usage.md#Liberica)
|
||||||
|
- [Liberica Native Image Kit](docs/advanced-usage.md#Liberica-Native-Image-Kit)
|
||||||
- [Microsoft](docs/advanced-usage.md#Microsoft)
|
- [Microsoft](docs/advanced-usage.md#Microsoft)
|
||||||
- [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto)
|
- [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto)
|
||||||
- [Oracle](docs/advanced-usage.md#Oracle)
|
- [Oracle](docs/advanced-usage.md#Oracle)
|
||||||
@@ -293,20 +334,12 @@ In the example above multiple JDKs are installed for the same job. The result af
|
|||||||
- [Testing against different Java distributions](docs/advanced-usage.md#Testing-against-different-Java-distributions)
|
- [Testing against different Java distributions](docs/advanced-usage.md#Testing-against-different-Java-distributions)
|
||||||
- [Testing against different platforms](docs/advanced-usage.md#Testing-against-different-platforms)
|
- [Testing against different platforms](docs/advanced-usage.md#Testing-against-different-platforms)
|
||||||
- [Publishing using Apache Maven](docs/advanced-usage.md#Publishing-using-Apache-Maven)
|
- [Publishing using Apache Maven](docs/advanced-usage.md#Publishing-using-Apache-Maven)
|
||||||
|
- [Maven transfer progress (download logs)](docs/advanced-usage.md#maven-transfer-progress-download-logs)
|
||||||
- [Publishing using Gradle](docs/advanced-usage.md#Publishing-using-Gradle)
|
- [Publishing using Gradle](docs/advanced-usage.md#Publishing-using-Gradle)
|
||||||
- [Hosted Tool Cache](docs/advanced-usage.md#Hosted-Tool-Cache)
|
- [Hosted Tool Cache](docs/advanced-usage.md#Hosted-Tool-Cache)
|
||||||
- [Modifying Maven Toolchains](docs/advanced-usage.md#Modifying-Maven-Toolchains)
|
- [Modifying Maven Toolchains](docs/advanced-usage.md#Modifying-Maven-Toolchains)
|
||||||
- [Java Version File](docs/advanced-usage.md#Java-version-file)
|
- [Java Version File](docs/advanced-usage.md#Java-version-file)
|
||||||
|
|
||||||
## V2 vs V1
|
|
||||||
|
|
||||||
Examples in this README use `actions/setup-java@v5`, but the main migration note from V1 still applies to all later major versions (`v2`, `v3`, `v4`, and `v5`):
|
|
||||||
|
|
||||||
- Starting with V2, the action supports custom distributions. V1 supports only Azul Zulu OpenJDK.
|
|
||||||
- Starting with V2, you must specify distribution along with the version. V1 defaults to Azul Zulu OpenJDK, so only version input is required. Follow [the migration guide](docs/switching-to-v2.md) to switch from V1 to V2.
|
|
||||||
|
|
||||||
For information about the latest releases, recent updates, and newly supported distributions, please refer to the `setup-java` [Releases](https://github.com/actions/setup-java/releases).
|
|
||||||
|
|
||||||
## Recommended permissions
|
## Recommended permissions
|
||||||
|
|
||||||
When using the `setup-java` action in your GitHub Actions workflow, it is recommended to set the following permissions to ensure proper functionality:
|
When using the `setup-java` action in your GitHub Actions workflow, it is recommended to set the following permissions to ensure proper functionality:
|
||||||
|
|||||||
+78
-8
@@ -1,24 +1,63 @@
|
|||||||
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
|
import {fileURLToPath} from 'url';
|
||||||
import * as io from '@actions/io';
|
import * as io from '@actions/io';
|
||||||
import * as core from '@actions/core';
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import * as auth from '../src/auth';
|
// Mock @actions/core before importing source modules that depend on it
|
||||||
import {M2_DIR, MVN_SETTINGS_FILE} from '../src/constants';
|
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 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 m2Dir = path.join(__dirname, M2_DIR);
|
||||||
const settingsFile = path.join(m2Dir, MVN_SETTINGS_FILE);
|
const settingsFile = path.join(m2Dir, MVN_SETTINGS_FILE);
|
||||||
|
|
||||||
describe('auth tests', () => {
|
describe('auth tests', () => {
|
||||||
let spyOSHomedir: jest.SpyInstance;
|
let spyOSHomedir: any;
|
||||||
let spyInfo: jest.SpyInstance;
|
let spyInfo: any;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await io.rmRF(m2Dir);
|
await io.rmRF(m2Dir);
|
||||||
spyOSHomedir = jest.spyOn(os, 'homedir');
|
spyOSHomedir = jest.spyOn(os, 'homedir');
|
||||||
spyOSHomedir.mockReturnValue(__dirname);
|
spyOSHomedir.mockReturnValue(__dirname);
|
||||||
spyInfo = jest.spyOn(core, 'info');
|
spyInfo = core.info as jest.Mock;
|
||||||
spyInfo.mockImplementation(() => null);
|
spyInfo.mockImplementation(() => null);
|
||||||
}, 300000);
|
}, 300000);
|
||||||
|
|
||||||
@@ -189,9 +228,40 @@ describe('auth tests', () => {
|
|||||||
<username>\${env.${username}}</username>
|
<username>\${env.${username}}</username>
|
||||||
<password>\${env.&<>"''"><&}</password>
|
<password>\${env.&<>"''"><&}</password>
|
||||||
</server>
|
</server>
|
||||||
|
</servers>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>setup-java-gpg</id>
|
||||||
|
<properties>
|
||||||
|
<gpg.passphraseEnvName>${gpgPassphrase}</gpg.passphraseEnvName>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
<activeProfiles>
|
||||||
|
<activeProfile>setup-java-gpg</activeProfile>
|
||||||
|
</activeProfiles>
|
||||||
|
</settings>`;
|
||||||
|
|
||||||
|
expect(auth.generate(id, username, password, gpgPassphrase)).toEqual(
|
||||||
|
expectedSettings
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not add a gpg profile when the passphrase env var is the maven-gpg-plugin default', () => {
|
||||||
|
const id = 'packages';
|
||||||
|
const username = 'USER';
|
||||||
|
const password = '&<>"\'\'"><&';
|
||||||
|
const gpgPassphrase = 'MAVEN_GPG_PASSPHRASE';
|
||||||
|
|
||||||
|
const expectedSettings = `<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||||
|
<interactiveMode>false</interactiveMode>
|
||||||
|
<servers>
|
||||||
<server>
|
<server>
|
||||||
<id>gpg.passphrase</id>
|
<id>${id}</id>
|
||||||
<passphrase>\${env.${gpgPassphrase}}</passphrase>
|
<username>\${env.${username}}</username>
|
||||||
|
<password>\${env.&<>"''"><&}</password>
|
||||||
</server>
|
</server>
|
||||||
</servers>
|
</servers>
|
||||||
</settings>`;
|
</settings>`;
|
||||||
|
|||||||
+324
-50
@@ -1,23 +1,84 @@
|
|||||||
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
import {mkdtempSync} from 'fs';
|
import {mkdtempSync} from 'fs';
|
||||||
import {tmpdir} from 'os';
|
import {tmpdir} from 'os';
|
||||||
import {join} from 'path';
|
import {join} from 'path';
|
||||||
import {restore, save} from '../src/cache';
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
import * as cache from '@actions/cache';
|
// Mock @actions/core before importing source modules that depend on it
|
||||||
import * as glob from '@actions/glob';
|
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');
|
||||||
|
|
||||||
describe('dependency cache', () => {
|
describe('dependency cache', () => {
|
||||||
const ORIGINAL_RUNNER_OS = process.env['RUNNER_OS'];
|
const ORIGINAL_RUNNER_OS = process.env['RUNNER_OS'];
|
||||||
const ORIGINAL_GITHUB_WORKSPACE = process.env['GITHUB_WORKSPACE'];
|
const ORIGINAL_GITHUB_WORKSPACE = process.env['GITHUB_WORKSPACE'];
|
||||||
const ORIGINAL_CWD = process.cwd();
|
const ORIGINAL_CWD = process.cwd();
|
||||||
let workspace: string;
|
let workspace: string;
|
||||||
let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>;
|
let spyInfo: any;
|
||||||
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>;
|
let spyWarning: any;
|
||||||
let spyDebug: jest.SpyInstance<void, Parameters<typeof core.debug>>;
|
let spyDebug: any;
|
||||||
let spySaveState: jest.SpyInstance<void, Parameters<typeof core.saveState>>;
|
let spySaveState: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
workspace = mkdtempSync(join(tmpdir(), 'setup-java-cache-'));
|
workspace = mkdtempSync(join(tmpdir(), 'setup-java-cache-'));
|
||||||
@@ -41,20 +102,20 @@ describe('dependency cache', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyInfo = jest.spyOn(core, 'info');
|
spyInfo = core.info as jest.Mock;
|
||||||
spyInfo.mockImplementation(() => null);
|
spyInfo.mockImplementation(() => null);
|
||||||
|
|
||||||
spyWarning = jest.spyOn(core, 'warning');
|
spyWarning = core.warning as jest.Mock;
|
||||||
spyWarning.mockImplementation(() => null);
|
spyWarning.mockImplementation(() => null);
|
||||||
|
|
||||||
spyDebug = jest.spyOn(core, 'debug');
|
spyDebug = core.debug as jest.Mock;
|
||||||
spyDebug.mockImplementation(() => null);
|
spyDebug.mockImplementation(() => null);
|
||||||
|
|
||||||
spySaveState = jest.spyOn(core, 'saveState');
|
spySaveState = core.saveState as jest.Mock;
|
||||||
spySaveState.mockImplementation(() => null);
|
spySaveState.mockImplementation(() => null);
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -70,22 +131,18 @@ describe('dependency cache', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('restore', () => {
|
describe('restore', () => {
|
||||||
let spyCacheRestore: jest.SpyInstance<
|
let spyCacheRestore: any;
|
||||||
ReturnType<typeof cache.restoreCache>,
|
let spyGlobHashFiles: any;
|
||||||
Parameters<typeof cache.restoreCache>
|
let spySetOutput: any;
|
||||||
>;
|
|
||||||
let spyGlobHashFiles: jest.SpyInstance<
|
|
||||||
ReturnType<typeof glob.hashFiles>,
|
|
||||||
Parameters<typeof glob.hashFiles>
|
|
||||||
>;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyCacheRestore = jest
|
spyCacheRestore = (cache.restoreCache as any).mockImplementation(
|
||||||
.spyOn(cache, 'restoreCache')
|
(paths: string[], primaryKey: string) => Promise.resolve(undefined)
|
||||||
.mockImplementation((paths: string[], primaryKey: string) =>
|
|
||||||
Promise.resolve(undefined)
|
|
||||||
);
|
);
|
||||||
spyGlobHashFiles = jest.spyOn(glob, 'hashFiles');
|
spyGlobHashFiles = glob.hashFiles as jest.Mock;
|
||||||
|
spyGlobHashFiles.mockResolvedValue('hash-stub');
|
||||||
|
spySetOutput = core.setOutput as jest.Mock;
|
||||||
|
spySetOutput.mockImplementation(() => null);
|
||||||
spyWarning.mockImplementation(() => null);
|
spyWarning.mockImplementation(() => null);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -96,11 +153,12 @@ describe('dependency cache', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('for maven', () => {
|
describe('for maven', () => {
|
||||||
it('throws error if no pom.xml or maven-wrapper.properties found', async () => {
|
it('throws error if no pom.xml, maven-wrapper.properties, or extensions.xml found', async () => {
|
||||||
|
spyGlobHashFiles.mockResolvedValue('');
|
||||||
await expect(restore('maven', '')).rejects.toThrow(
|
await expect(restore('maven', '')).rejects.toThrow(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
)} matched to [**/pom.xml,**/.mvn/wrapper/maven-wrapper.properties], make sure you have checked out the target repository`
|
)} matched to [**/pom.xml,**/.mvn/wrapper/maven-wrapper.properties,**/.mvn/extensions.xml], make sure you have checked out the target repository`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('downloads cache based on pom.xml', async () => {
|
it('downloads cache based on pom.xml', async () => {
|
||||||
@@ -108,18 +166,24 @@ describe('dependency cache', () => {
|
|||||||
|
|
||||||
await restore('maven', '');
|
await restore('maven', '');
|
||||||
expect(spyCacheRestore).toHaveBeenCalledWith(
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
[
|
[join(os.homedir(), '.m2', 'repository')],
|
||||||
join(os.homedir(), '.m2', 'repository'),
|
|
||||||
join(os.homedir(), '.m2', 'wrapper', 'dists')
|
|
||||||
],
|
|
||||||
expect.any(String)
|
expect.any(String)
|
||||||
);
|
);
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties'
|
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties\n**/.mvn/extensions.xml'
|
||||||
);
|
);
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toHaveBeenCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
|
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
|
||||||
});
|
});
|
||||||
|
it('sets the cache-primary-key output', async () => {
|
||||||
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
|
||||||
|
await restore('maven', '');
|
||||||
|
expect(spySetOutput).toHaveBeenCalledWith(
|
||||||
|
'cache-primary-key',
|
||||||
|
expect.stringContaining('setup-java-')
|
||||||
|
);
|
||||||
|
});
|
||||||
it('downloads cache based on maven-wrapper.properties', async () => {
|
it('downloads cache based on maven-wrapper.properties', async () => {
|
||||||
createDirectory(join(workspace, '.mvn'));
|
createDirectory(join(workspace, '.mvn'));
|
||||||
createDirectory(join(workspace, '.mvn', 'wrapper'));
|
createDirectory(join(workspace, '.mvn', 'wrapper'));
|
||||||
@@ -129,21 +193,75 @@ describe('dependency cache', () => {
|
|||||||
|
|
||||||
await restore('maven', '');
|
await restore('maven', '');
|
||||||
expect(spyCacheRestore).toHaveBeenCalledWith(
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
[
|
[join(os.homedir(), '.m2', 'repository')],
|
||||||
join(os.homedir(), '.m2', 'repository'),
|
|
||||||
join(os.homedir(), '.m2', 'wrapper', 'dists')
|
|
||||||
],
|
|
||||||
expect.any(String)
|
expect.any(String)
|
||||||
);
|
);
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||||
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties'
|
'**/pom.xml\n**/.mvn/wrapper/maven-wrapper.properties\n**/.mvn/extensions.xml'
|
||||||
);
|
);
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toHaveBeenCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
|
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')],
|
||||||
|
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('restores the maven wrapper distribution cache independently of the main cache', async () => {
|
||||||
|
createDirectory(join(workspace, '.mvn'));
|
||||||
|
createDirectory(join(workspace, '.mvn', 'wrapper'));
|
||||||
|
createFile(
|
||||||
|
join(workspace, '.mvn', 'wrapper', 'maven-wrapper.properties')
|
||||||
|
);
|
||||||
|
|
||||||
|
await restore('maven', '');
|
||||||
|
// Main dependency cache no longer carries the wrapper dists path.
|
||||||
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.m2', 'repository')],
|
||||||
|
expect.any(String)
|
||||||
|
);
|
||||||
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.m2', 'wrapper', 'dists')],
|
||||||
|
expect.stringContaining('maven-wrapper')
|
||||||
|
);
|
||||||
|
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||||
|
'**/.mvn/wrapper/maven-wrapper.properties'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('skips the maven wrapper cache when no wrapper properties exist', async () => {
|
||||||
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
spyGlobHashFiles.mockImplementation((pattern: string) =>
|
||||||
|
Promise.resolve(
|
||||||
|
pattern === '**/.mvn/wrapper/maven-wrapper.properties'
|
||||||
|
? ''
|
||||||
|
: 'hash-stub'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
await restore('maven', '');
|
||||||
|
// Only the main dependency cache is restored; the wrapper cache path is
|
||||||
|
// never touched because the project does not use mvnw.
|
||||||
|
expect(spyCacheRestore).toHaveBeenCalledTimes(1);
|
||||||
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.m2', 'repository')],
|
||||||
|
expect.any(String)
|
||||||
|
);
|
||||||
|
expect(spyWarning).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
describe('for gradle', () => {
|
describe('for gradle', () => {
|
||||||
it('throws error if no build.gradle found', async () => {
|
it('throws error if no build.gradle found', async () => {
|
||||||
|
spyGlobHashFiles.mockResolvedValue('');
|
||||||
await expect(restore('gradle', '')).rejects.toThrow(
|
await expect(restore('gradle', '')).rejects.toThrow(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
@@ -196,9 +314,47 @@ describe('dependency cache', () => {
|
|||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toHaveBeenCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
||||||
});
|
});
|
||||||
|
it('restores the gradle wrapper distribution cache independently of the main cache', async () => {
|
||||||
|
createFile(join(workspace, 'build.gradle'));
|
||||||
|
|
||||||
|
await restore('gradle', '');
|
||||||
|
// Main dependency cache no longer carries the wrapper path.
|
||||||
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.gradle', 'caches')],
|
||||||
|
expect.any(String)
|
||||||
|
);
|
||||||
|
// Wrapper distribution is restored on its own, keyed only on the
|
||||||
|
// wrapper properties file.
|
||||||
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.gradle', 'wrapper')],
|
||||||
|
expect.stringContaining('setup-java-')
|
||||||
|
);
|
||||||
|
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
||||||
|
'**/gradle-wrapper.properties'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('skips the gradle wrapper cache when no wrapper properties exist', async () => {
|
||||||
|
createFile(join(workspace, 'build.gradle'));
|
||||||
|
spyGlobHashFiles.mockImplementation((pattern: string) =>
|
||||||
|
Promise.resolve(
|
||||||
|
pattern === '**/gradle-wrapper.properties' ? '' : 'hash-stub'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
await restore('gradle', '');
|
||||||
|
// Only the main dependency cache is restored; the wrapper cache path is
|
||||||
|
// never touched because the project does not use the gradle wrapper.
|
||||||
|
expect(spyCacheRestore).toHaveBeenCalledTimes(1);
|
||||||
|
expect(spyCacheRestore).toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.gradle', 'caches')],
|
||||||
|
expect.any(String)
|
||||||
|
);
|
||||||
|
expect(spyWarning).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
describe('for sbt', () => {
|
describe('for sbt', () => {
|
||||||
it('throws error if no build.sbt found', async () => {
|
it('throws error if no build.sbt found', async () => {
|
||||||
|
spyGlobHashFiles.mockResolvedValue('');
|
||||||
await expect(restore('sbt', '')).rejects.toThrow(
|
await expect(restore('sbt', '')).rejects.toThrow(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
@@ -217,6 +373,13 @@ describe('dependency cache', () => {
|
|||||||
expect(spyInfo).toHaveBeenCalledWith('sbt cache is not found');
|
expect(spyInfo).toHaveBeenCalledWith('sbt cache is not found');
|
||||||
});
|
});
|
||||||
it('detects scala and sbt changes under **/project/ folder', async () => {
|
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'));
|
createFile(join(workspace, 'build.sbt'));
|
||||||
createDirectory(join(workspace, 'project'));
|
createDirectory(join(workspace, 'project'));
|
||||||
createFile(join(workspace, 'project/DependenciesV1.scala'));
|
createFile(join(workspace, 'project/DependenciesV1.scala'));
|
||||||
@@ -252,6 +415,7 @@ describe('dependency cache', () => {
|
|||||||
});
|
});
|
||||||
describe('cache-dependency-path', () => {
|
describe('cache-dependency-path', () => {
|
||||||
it('throws error if no matching dependency file found', async () => {
|
it('throws error if no matching dependency file found', async () => {
|
||||||
|
spyGlobHashFiles.mockResolvedValue('');
|
||||||
createFile(join(workspace, 'build.gradle.kts'));
|
createFile(join(workspace, 'build.gradle.kts'));
|
||||||
await expect(
|
await expect(
|
||||||
restore('gradle', 'sub-project/**/build.gradle.kts')
|
restore('gradle', 'sub-project/**/build.gradle.kts')
|
||||||
@@ -293,16 +457,11 @@ describe('dependency cache', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('save', () => {
|
describe('save', () => {
|
||||||
let spyCacheSave: jest.SpyInstance<
|
let spyCacheSave: any;
|
||||||
ReturnType<typeof cache.saveCache>,
|
|
||||||
Parameters<typeof cache.saveCache>
|
|
||||||
>;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyCacheSave = jest
|
spyCacheSave = (cache.saveCache as any).mockImplementation(
|
||||||
.spyOn(cache, 'saveCache')
|
(paths: string[], key: string) => Promise.resolve(0)
|
||||||
.mockImplementation((paths: string[], key: string) =>
|
|
||||||
Promise.resolve(0)
|
|
||||||
);
|
);
|
||||||
spyWarning.mockImplementation(() => null);
|
spyWarning.mockImplementation(() => null);
|
||||||
});
|
});
|
||||||
@@ -367,6 +526,77 @@ describe('dependency cache', () => {
|
|||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
expect.stringMatching(/^Cache saved with the key:.*/)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('saves the maven wrapper distribution cache under its own key', async () => {
|
||||||
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||||
|
switch (name) {
|
||||||
|
case 'cache-primary-key':
|
||||||
|
return 'setup-java-cache-primary-key';
|
||||||
|
case 'cache-matched-key':
|
||||||
|
return 'setup-java-cache-matched-key';
|
||||||
|
case 'cache-primary-key-maven-wrapper':
|
||||||
|
return 'setup-java-maven-wrapper-key';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await save('maven');
|
||||||
|
expect(spyCacheSave).toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.m2', 'wrapper', 'dists')],
|
||||||
|
'setup-java-maven-wrapper-key'
|
||||||
|
);
|
||||||
|
expect(spyWarning).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
it('does not save the maven wrapper cache on an exact wrapper hit', async () => {
|
||||||
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||||
|
switch (name) {
|
||||||
|
case 'cache-primary-key':
|
||||||
|
return 'setup-java-cache-primary-key';
|
||||||
|
case 'cache-matched-key':
|
||||||
|
return 'setup-java-cache-matched-key';
|
||||||
|
case 'cache-primary-key-maven-wrapper':
|
||||||
|
case 'cache-matched-key-maven-wrapper':
|
||||||
|
return 'setup-java-maven-wrapper-key';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await save('maven');
|
||||||
|
expect(spyCacheSave).not.toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.m2', 'wrapper', 'dists')],
|
||||||
|
expect.any(String)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
it('does not fail the post step when the wrapper distribution path is missing', async () => {
|
||||||
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||||
|
switch (name) {
|
||||||
|
case 'cache-primary-key':
|
||||||
|
return 'setup-java-cache-primary-key';
|
||||||
|
case 'cache-matched-key':
|
||||||
|
return 'setup-java-cache-matched-key';
|
||||||
|
case 'cache-primary-key-maven-wrapper':
|
||||||
|
return 'setup-java-maven-wrapper-key';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
spyCacheSave.mockImplementation((paths: string[]) =>
|
||||||
|
paths.includes(join(os.homedir(), '.m2', 'wrapper', 'dists'))
|
||||||
|
? Promise.reject(
|
||||||
|
new cache.ValidationError(
|
||||||
|
'Path Validation Error: Path(s) specified in the action for caching do(es) not exist'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
: Promise.resolve(0)
|
||||||
|
);
|
||||||
|
|
||||||
|
await expect(save('maven')).resolves.toBeUndefined();
|
||||||
|
expect(spyWarning).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
describe('for gradle', () => {
|
describe('for gradle', () => {
|
||||||
it('uploads cache even if no build.gradle found', async () => {
|
it('uploads cache even if no build.gradle found', async () => {
|
||||||
@@ -419,6 +649,50 @@ describe('dependency cache', () => {
|
|||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
expect.stringMatching(/^Cache saved with the key:.*/)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
it('saves the gradle wrapper distribution cache under its own key', async () => {
|
||||||
|
createFile(join(workspace, 'build.gradle'));
|
||||||
|
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||||
|
switch (name) {
|
||||||
|
case 'cache-primary-key':
|
||||||
|
return 'setup-java-cache-primary-key';
|
||||||
|
case 'cache-matched-key':
|
||||||
|
return 'setup-java-cache-matched-key';
|
||||||
|
case 'cache-primary-key-gradle-wrapper':
|
||||||
|
return 'setup-java-gradle-wrapper-key';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await save('gradle');
|
||||||
|
expect(spyCacheSave).toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.gradle', 'wrapper')],
|
||||||
|
'setup-java-gradle-wrapper-key'
|
||||||
|
);
|
||||||
|
expect(spyWarning).not.toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
it('does not save the gradle wrapper cache on an exact wrapper hit', async () => {
|
||||||
|
createFile(join(workspace, 'build.gradle'));
|
||||||
|
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||||
|
switch (name) {
|
||||||
|
case 'cache-primary-key':
|
||||||
|
return 'setup-java-cache-primary-key';
|
||||||
|
case 'cache-matched-key':
|
||||||
|
return 'setup-java-cache-matched-key';
|
||||||
|
case 'cache-primary-key-gradle-wrapper':
|
||||||
|
case 'cache-matched-key-gradle-wrapper':
|
||||||
|
return 'setup-java-gradle-wrapper-key';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await save('gradle');
|
||||||
|
expect(spyCacheSave).not.toHaveBeenCalledWith(
|
||||||
|
[join(os.homedir(), '.gradle', 'wrapper')],
|
||||||
|
expect.any(String)
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
describe('for sbt', () => {
|
describe('for sbt', () => {
|
||||||
it('uploads cache even if no build.sbt found', async () => {
|
it('uploads cache even if no build.sbt found', async () => {
|
||||||
@@ -463,14 +737,14 @@ describe('dependency cache', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function resetState() {
|
function resetState() {
|
||||||
jest.spyOn(core, 'getState').mockReset();
|
(core.getState as jest.Mock).mockReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create states to emulate a restore process without build file.
|
* Create states to emulate a restore process without build file.
|
||||||
*/
|
*/
|
||||||
function createStateForMissingBuildFile() {
|
function createStateForMissingBuildFile() {
|
||||||
jest.spyOn(core, 'getState').mockImplementation(name => {
|
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'cache-primary-key':
|
case 'cache-primary-key':
|
||||||
return 'setup-java-cache-';
|
return 'setup-java-cache-';
|
||||||
@@ -484,7 +758,7 @@ function createStateForMissingBuildFile() {
|
|||||||
* Create states to emulate a successful restore process.
|
* Create states to emulate a successful restore process.
|
||||||
*/
|
*/
|
||||||
function createStateForSuccessfulRestore() {
|
function createStateForSuccessfulRestore() {
|
||||||
jest.spyOn(core, 'getState').mockImplementation(name => {
|
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'cache-primary-key':
|
case 'cache-primary-key':
|
||||||
return 'setup-java-cache-primary-key';
|
return 'setup-java-cache-primary-key';
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
target/
|
||||||
|
pom.xml.tag
|
||||||
|
pom.xml.releaseBackup
|
||||||
|
pom.xml.versionsBackup
|
||||||
|
pom.xml.next
|
||||||
|
release.properties
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
buildNumber.properties
|
||||||
|
.mvn/timing.properties
|
||||||
|
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
|
||||||
|
.mvn/wrapper/maven-wrapper.jar
|
||||||
Vendored
+15
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>io.github.actions</groupId>
|
||||||
|
<artifactId>setup-java-maven2-example</artifactId>
|
||||||
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>3.12.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
target/
|
||||||
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
ThisBuild / scalaVersion := "2.12.15"
|
||||||
|
|
||||||
|
libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "2.1.1"
|
||||||
Executable
+39
@@ -0,0 +1,39 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Assert whether a directory exists, for use in the e2e cache workflows.
|
||||||
|
#
|
||||||
|
# Usage: check-dir.sh <dir> [present|absent]
|
||||||
|
#
|
||||||
|
# present (default): fail if <dir> does NOT exist, otherwise list its contents.
|
||||||
|
# absent: fail if <dir> DOES exist.
|
||||||
|
#
|
||||||
|
# Call with already-expanded paths (e.g. "$HOME/.gradle/caches") to avoid
|
||||||
|
# tilde-expansion pitfalls.
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if [ "$#" -lt 1 ]; then
|
||||||
|
echo "Usage: check-dir.sh <dir> [present|absent]" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
dir=$1
|
||||||
|
mode=${2:-present}
|
||||||
|
|
||||||
|
case "$mode" in
|
||||||
|
present)
|
||||||
|
if [ ! -d "$dir" ]; then
|
||||||
|
echo "::error::The $dir directory does not exist unexpectedly"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
ls "$dir"
|
||||||
|
;;
|
||||||
|
absent)
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
echo "::error::The $dir directory exists unexpectedly"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "::error::Unknown mode '$mode' (expected 'present' or 'absent')"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -1,32 +1,87 @@
|
|||||||
import {run as cleanup} from '../src/cleanup-java';
|
import {
|
||||||
import * as core from '@actions/core';
|
jest,
|
||||||
import * as cache from '@actions/cache';
|
describe,
|
||||||
import * as util from '../src/util';
|
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');
|
||||||
|
|
||||||
describe('cleanup', () => {
|
describe('cleanup', () => {
|
||||||
let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>;
|
let spyWarning: any;
|
||||||
let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>;
|
let spyInfo: any;
|
||||||
let spyCacheSave: jest.SpyInstance<
|
let spyCacheSave: any;
|
||||||
ReturnType<typeof cache.saveCache>,
|
let spyJobStatusSuccess: any;
|
||||||
Parameters<typeof cache.saveCache>
|
let spyCoreError: any;
|
||||||
>;
|
|
||||||
let spyJobStatusSuccess: jest.SpyInstance;
|
|
||||||
let spyCoreError: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyWarning = jest.spyOn(core, 'warning');
|
spyWarning = core.warning as jest.Mock;
|
||||||
spyWarning.mockImplementation(() => null);
|
spyWarning.mockImplementation(() => null);
|
||||||
|
|
||||||
spyInfo = jest.spyOn(core, 'info');
|
spyInfo = core.info as jest.Mock;
|
||||||
spyInfo.mockImplementation(() => null);
|
spyInfo.mockImplementation(() => null);
|
||||||
|
|
||||||
spyCacheSave = jest.spyOn(cache, 'saveCache');
|
spyCacheSave = cache.saveCache as jest.Mock;
|
||||||
|
|
||||||
spyJobStatusSuccess = jest.spyOn(util, 'isJobStatusSuccess');
|
spyJobStatusSuccess = util.isJobStatusSuccess as jest.Mock;
|
||||||
spyJobStatusSuccess.mockReturnValue(true);
|
spyJobStatusSuccess.mockReturnValue(true);
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
|
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
@@ -47,7 +102,7 @@ describe('cleanup', () => {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
|
(core.getInput as jest.Mock<any>).mockImplementation((name: string) => {
|
||||||
return name === 'cache' ? 'gradle' : '';
|
return name === 'cache' ? 'gradle' : '';
|
||||||
});
|
});
|
||||||
await cleanup();
|
await cleanup();
|
||||||
@@ -59,7 +114,7 @@ describe('cleanup', () => {
|
|||||||
spyCacheSave.mockImplementation((paths: string[], key: string) =>
|
spyCacheSave.mockImplementation((paths: string[], key: string) =>
|
||||||
Promise.reject(new Error('Unexpected error'))
|
Promise.reject(new Error('Unexpected error'))
|
||||||
);
|
);
|
||||||
jest.spyOn(core, 'getInput').mockImplementation((name: string) => {
|
(core.getInput as jest.Mock<any>).mockImplementation((name: string) => {
|
||||||
return name === 'cache' ? 'gradle' : '';
|
return name === 'cache' ? 'gradle' : '';
|
||||||
});
|
});
|
||||||
await cleanup();
|
await cleanup();
|
||||||
@@ -68,14 +123,14 @@ describe('cleanup', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function resetState() {
|
function resetState() {
|
||||||
jest.spyOn(core, 'getState').mockReset();
|
(core.getState as jest.Mock).mockReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create states to emulate a successful restore process.
|
* Create states to emulate a successful restore process.
|
||||||
*/
|
*/
|
||||||
function createStateForSuccessfulRestore() {
|
function createStateForSuccessfulRestore() {
|
||||||
jest.spyOn(core, 'getState').mockImplementation(name => {
|
(core.getState as jest.Mock<any>).mockImplementation((name: any) => {
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'cache-primary-key':
|
case 'cache-primary-key':
|
||||||
return 'setup-java-cache-primary-key';
|
return 'setup-java-cache-primary-key';
|
||||||
|
|||||||
@@ -158,5 +158,45 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
],
|
||||||
|
"25": [
|
||||||
|
{
|
||||||
|
"version": "25.0.3",
|
||||||
|
"jdkVersion": "25.0.3",
|
||||||
|
"latest": true,
|
||||||
|
"baseUrl": "https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/",
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"os": "linux",
|
||||||
|
"arch": "aarch64",
|
||||||
|
"filename": "TencentKona-25.0.3.b1-jdk_linux-aarch64.tar.gz",
|
||||||
|
"checksum": "2fb77e3ba9c00045ca497ea22210f18dae4bf7df4c87029f5abadd42a5daf8c7"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"os": "linux",
|
||||||
|
"arch": "x86_64",
|
||||||
|
"filename": "TencentKona-25.0.3.b1-jdk_linux-x86_64.tar.gz",
|
||||||
|
"checksum": "47445e6fad020e834055a705bb48fa3cd0727a2c57ad6f1c5206a45f4efb2d67"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"os": "macos",
|
||||||
|
"arch": "aarch64",
|
||||||
|
"filename": "TencentKona-25.0.3.b1_jdk_macosx-aarch64_notarized.tar.gz",
|
||||||
|
"checksum": "e29405eff95da412ed7ecc890e6ef5ebbfcd9ab334005b3d32d1700bbe4204d2"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"os": "macos",
|
||||||
|
"arch": "x86_64",
|
||||||
|
"filename": "TencentKona-25.0.3.b1_jdk_macosx-x86_64_notarized.tar.gz",
|
||||||
|
"checksum": "d512db5c079db16bd3a9c86d9cb979808994e90e4de29e17d27e5219fe488659"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"os": "windows",
|
||||||
|
"arch": "x86_64",
|
||||||
|
"filename": "TencentKona-25.0.3.b1_jdk_windows-x86_64_signed.zip",
|
||||||
|
"checksum": "865bce92ccbbca75115076e618a98baa1d0f30fcccdce954c0a22bee33d6ae83"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,739 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.1+3-25.0.1+16/bellsoft-liberica-vm-openjdk25.0.1+16-25.0.1+3-linux-amd64.tar.gz",
|
||||||
|
"version": "25.0.1+3",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "25.0.1+16",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.1.0+1-23+38/bellsoft-liberica-vm-openjdk23+38-24.1.0+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.1.0+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "23+38",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.2/bellsoft-liberica-vm-openjdk11.0.15.1+2-21.3.2+2-linux-amd64.tar.gz",
|
||||||
|
"version": "21.3.2+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.15.1+2",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.0/bellsoft-liberica-vm-openjdk17.0.5+8-22.3.0+2-linux-amd64.tar.gz",
|
||||||
|
"version": "22.3.0+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.5+8",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.9+1-17.0.16+13/bellsoft-liberica-vm-openjdk17.0.16+13-23.0.9+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.9+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.16+13",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/23.0.0/bellsoft-liberica-vm-openjdk17.0.7+7-23.0.0+1-src.tar.gz",
|
||||||
|
"version": "23.0.0+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.7+7",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.2+1-25.0.2+13/bellsoft-liberica-vm-openjdk25.0.2+13-25.0.2+1-linux-amd64.tar.gz",
|
||||||
|
"version": "25.0.2+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "25.0.2+13",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.1.1+1-23.0.1+13/bellsoft-liberica-vm-openjdk23.0.1+13-24.1.1+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.1.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "23.0.1+13",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.12+1-17.0.19+12/bellsoft-liberica-vm-openjdk17.0.19+12-23.0.12+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.12+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.19+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.3+1-17.0.10+13/bellsoft-liberica-vm-openjdk17.0.10+13-23.0.3+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.3+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.10+13",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.2/bellsoft-liberica-vm-openjdk11-21.3.2-src.tar.gz",
|
||||||
|
"version": "21.3.2+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.15+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.3/bellsoft-liberica-vm-openjdk11.0.20+8-22.3.3+1-src.tar.gz",
|
||||||
|
"version": "22.3.3+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.20+8",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.8+1-17.0.15+10/bellsoft-liberica-vm-openjdk17.0.15+10-23.0.8+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.8+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.15+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.3/bellsoft-liberica-vm-openjdk17.0.4-21.3.3-src.tar.gz",
|
||||||
|
"version": "21.3.3+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.4+8",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.7+1-21.0.7+9/bellsoft-liberica-vm-openjdk21.0.7+9-23.1.7+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.7+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.7+9",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.8+1-21.0.8+13/bellsoft-liberica-vm-openjdk21.0.8+13-23.1.8+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.8+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.8+13",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.0.0.2/bellsoft-liberica-vm-openjdk11-21.0.0.2-src.tar.gz",
|
||||||
|
"version": "21.0.0.2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.10+9",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/23.0.1/bellsoft-liberica-vm-openjdk17.0.8+7-23.0.1+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.8+7",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.0.0+1-22+37/bellsoft-liberica-vm-openjdk22+37-24.0.0+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.0.0+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "22+37",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.1.0/bellsoft-liberica-vm-openjdk17-22.1.0-src.tar.gz",
|
||||||
|
"version": "22.1.0+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.3+7",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.0.2+1-22.0.2+11/bellsoft-liberica-vm-openjdk22.0.2+11-24.0.2+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.0.2+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "22.0.2+11",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/23.0.1/bellsoft-liberica-vm-openjdk20.0.2+10-23.0.1+1-src.tar.gz",
|
||||||
|
"version": "23.0.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "20.0.2+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/23.1.0/bellsoft-liberica-vm-openjdk21+37-23.1.0+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.0+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21+37",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.4+3-21.0.4+9/bellsoft-liberica-vm-openjdk21.0.4+9-23.1.4+3-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.4+3",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.4+9",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.3/bellsoft-liberica-vm-openjdk11.0.20.1+1-22.3.3+2-linux-amd64.tar.gz",
|
||||||
|
"version": "22.3.3+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.20.1+1",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.4+1-17.0.11+10/bellsoft-liberica-vm-openjdk17.0.11+10-23.0.4+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.4+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.11+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.1.2+1-23.0.2+9/bellsoft-liberica-vm-openjdk23.0.2+9-24.1.2+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.1.2+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "23.0.2+9",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.10+1-17.0.17+12/bellsoft-liberica-vm-openjdk17.0.17+12-23.0.10+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.10+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.17+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.1/bellsoft-liberica-vm-openjdk11.0.18+10-22.3.1+1-src.tar.gz",
|
||||||
|
"version": "22.3.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.18+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.0.0.2/bellsoft-liberica-vm-openjdk17-22.0.0.2-src.tar.gz",
|
||||||
|
"version": "22.0.0.2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.2+9",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.0.0.2/bellsoft-liberica-vm-openjdk11-22.0.0.2-linux-amd64.tar.gz",
|
||||||
|
"version": "22.0.0.2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.14.1+1",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.1+2-25.0.1+14/bellsoft-liberica-vm-openjdk25.0.1+14-25.0.1+2-linux-amd64.tar.gz",
|
||||||
|
"version": "25.0.1+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "25.0.1+14",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.3/bellsoft-liberica-vm-openjdk11.0.16-21.3.3-src.tar.gz",
|
||||||
|
"version": "21.3.3+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.16+8",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.5+1-21.0.5+11/bellsoft-liberica-vm-openjdk21.0.5+11-23.1.5+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.5+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.5+11",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.4/bellsoft-liberica-vm-openjdk17.0.9+11-22.3.4+1-linux-amd64.tar.gz",
|
||||||
|
"version": "22.3.4+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.9+11",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.0+1-25+37/bellsoft-liberica-vm-openjdk25+37-25.0.0+1-linux-amd64.tar.gz",
|
||||||
|
"version": "25.0.0+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "25+37",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.3/bellsoft-liberica-vm-openjdk17.0.8.1+1-22.3.3+2-linux-amd64.tar.gz",
|
||||||
|
"version": "22.3.3+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.8.1+1",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.3+1-21.0.3+10/bellsoft-liberica-vm-openjdk21.0.3+10-23.1.3+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.3+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.3+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.2.0+1-24+37/bellsoft-liberica-vm-openjdk24+37-24.2.0+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.2.0+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "24+37",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/23.1.1/bellsoft-liberica-vm-openjdk21.0.1+12-23.1.1+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.1+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.3/bellsoft-liberica-vm-openjdk17.0.4.1-21.3.3-src.tar.gz",
|
||||||
|
"version": "21.3.3+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.4.1+1",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.11+2-21.0.11+12/bellsoft-liberica-vm-openjdk21.0.11+12-23.1.11+2-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.11+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.11+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.2/bellsoft-liberica-vm-openjdk11.0.19+7-22.3.2+1-src.tar.gz",
|
||||||
|
"version": "22.3.2+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.19+7",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.4/bellsoft-liberica-vm-openjdk11.0.21+10-22.3.4+1-src.tar.gz",
|
||||||
|
"version": "22.3.4+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.21+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.3+2-25.0.3+12/bellsoft-liberica-vm-openjdk25.0.3+12-25.0.3+2-linux-amd64.tar.gz",
|
||||||
|
"version": "25.0.3+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "25.0.3+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.2/bellsoft-liberica-vm-openjdk17.0.3.1+2-21.3.2+2-linux-amd64.tar.gz",
|
||||||
|
"version": "21.3.2+2",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.3.1+2",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.2.1+1-24.0.1+11/bellsoft-liberica-vm-openjdk24.0.1+11-24.2.1+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.2.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "24.0.1+11",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.2.0/bellsoft-liberica-vm-openjdk11.0.16.1+1-22.2.0+3-linux-amd64.tar.gz",
|
||||||
|
"version": "22.2.0+3",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.16.1+1",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.6+1-17.0.13+12/bellsoft-liberica-vm-openjdk17.0.13+12-23.0.6+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.6+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.13+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/23.0.0/bellsoft-liberica-vm-openjdk20.0.1+10-23.0.0+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.0+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "20.0.1+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.10+1-21.0.10+11/bellsoft-liberica-vm-openjdk21.0.10+11-23.1.10+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.10+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.10+11",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/22.3.1/bellsoft-liberica-vm-openjdk17.0.6+10-22.3.1+1-src.tar.gz",
|
||||||
|
"version": "22.3.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.6+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.0/bellsoft-liberica-vm-openjdk17-21.3.0-src.tar.gz",
|
||||||
|
"version": "21.3.0",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.1+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.0/bellsoft-liberica-vm-openjdk11-21.3.0-src.tar.gz",
|
||||||
|
"version": "21.3.0",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.13+8",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.0.1+1-22.0.1+10/bellsoft-liberica-vm-openjdk22.0.1+10-24.0.1+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.0.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "22.0.1+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.7+1-17.0.14+10/bellsoft-liberica-vm-openjdk17.0.14+10-23.0.7+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.7+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.14+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.1.0/bellsoft-liberica-vm-openjdk11-21.1.0-src.tar.gz",
|
||||||
|
"version": "21.1.0",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.11+9",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.6+1-21.0.6+10/bellsoft-liberica-vm-openjdk21.0.6+10-23.1.6+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.6+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.6+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/25.0.1+1-25.0.1+12/bellsoft-liberica-vm-openjdk25.0.1+12-25.0.1+1-linux-amd64.tar.gz",
|
||||||
|
"version": "25.0.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "25.0.1+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.9+1-21.0.9+12/bellsoft-liberica-vm-openjdk21.0.9+12-23.1.9+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.9+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.9+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/22.3.5+1-11.0.22+12/bellsoft-liberica-vm-openjdk11.0.22+12-22.3.5+1-linux-amd64.tar.gz",
|
||||||
|
"version": "22.3.5+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.22+12",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.5+1-17.0.12+10/bellsoft-liberica-vm-openjdk17.0.12+10-23.0.5+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.5+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.12+10",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.3.3.1/bellsoft-liberica-vm-openjdk11.0.17+7-21.3.3.1+1-linux-amd64.tar.gz",
|
||||||
|
"version": "21.3.3.1+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.17+7",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://download.bell-sw.com/vm/21.2.0/bellsoft-liberica-vm-openjdk11-21.2.0-linux-amd64.tar.gz",
|
||||||
|
"version": "21.2.0",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "11.0.12+7",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.0.11+1-17.0.18+11/bellsoft-liberica-vm-openjdk17.0.18+11-23.0.11+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.0.11+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "17.0.18+11",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/23.1.2+1-21.0.2+14/bellsoft-liberica-vm-openjdk21.0.2+14-23.1.2+1-linux-amd64.tar.gz",
|
||||||
|
"version": "23.1.2+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "21.0.2+14",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"downloadUrl": "https://github.com/bell-sw/LibericaNIK/releases/download/24.2.2+1-24.0.2+13/bellsoft-liberica-vm-openjdk24.0.2+13-24.2.2+1-linux-amd64.tar.gz",
|
||||||
|
"version": "24.2.2+1",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
"component": "liberica",
|
||||||
|
"version": "24.0.2+13",
|
||||||
|
"embedded": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
+576
-144
@@ -1,254 +1,686 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": 10996,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu1.8.0_05-8.1.0.10-linux.tar.gz",
|
||||||
"zulu_version": [8, 1, 0, 10],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-linux.tar.gz",
|
||||||
"jdk_version": [8, 0, 5, 13]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10997,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu1.8.0_11-8.2.0.1-linux.tar.gz",
|
||||||
"zulu_version": [8, 2, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-linux.tar.gz",
|
||||||
"jdk_version": [8, 0, 11, 12]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
11
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10346,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.21.0.1-jdk8.0.131-linux_x64.tar.gz",
|
||||||
"zulu_version": [8, 21, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-linux_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 131, 11]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
131
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 11,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
21,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10362,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
|
||||||
"zulu_version": [8, 23, 0, 3],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-linux_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 144, 1]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
144
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 1,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
23,
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10399,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.25.0.1-jdk8.0.152-linux_x64.tar.gz",
|
||||||
"zulu_version": [8, 25, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-linux_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 152, 16]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
152
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 16,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
25,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11355,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.46.0.19-ca-jdk8.0.252-linux_x64.tar.gz",
|
||||||
"zulu_version": [8, 46, 0, 19],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-linux_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 252, 14]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
252
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 14,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
46,
|
||||||
|
0,
|
||||||
|
19
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11481,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.47-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 47],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 17]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 17,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
47
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11622,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.51-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 51],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 19]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 19,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
51
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11535,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.49-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 49],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-linux_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 18]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 18,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
49
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12424,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz",
|
||||||
"zulu_version": [8, 52, 0, 23],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-linux_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 282, 8]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
282
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
52,
|
||||||
|
0,
|
||||||
|
23
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10383,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu9.0.0.15-jdk9.0.0-linux_x64.tar.gz",
|
||||||
"zulu_version": [9, 0, 0, 15],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-linux_x64.tar.gz",
|
||||||
"jdk_version": [9, 0, 0, 0]
|
"java_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 0,
|
||||||
|
"distro_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
15
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10413,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu9.0.1.3-jdk9.0.1-linux_x64.tar.gz",
|
||||||
"zulu_version": [9, 0, 1, 3],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-linux_x64.tar.gz",
|
||||||
"jdk_version": [9, 0, 1, 0]
|
"java_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 0,
|
||||||
|
"distro_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10503,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu10.2+3-jdk10.0.1-linux_x64.tar.gz",
|
||||||
"zulu_version": [10, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-linux_x64.tar.gz",
|
||||||
"jdk_version": [10, 0, 1, 9]
|
"java_version": [
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
10,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10541,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu10.3+5-jdk10.0.2-linux_x64.tar.gz",
|
||||||
"zulu_version": [10, 3, 5, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-linux_x64.tar.gz",
|
||||||
"jdk_version": [10, 0, 2, 13]
|
"java_version": [
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
10,
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10576,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.2.3-jdk11.0.1-linux_x64.tar.gz",
|
||||||
"zulu_version": [11, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-linux_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 1, 13]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10604,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.29.3-ca-jdk11.0.2-linux_x64.tar.gz",
|
||||||
"zulu_version": [11, 29, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-linux_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 2, 7]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
29,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10687,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz",
|
||||||
"zulu_version": [11, 31, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-linux_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 3, 7]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
31,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10856,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 13, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
13,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10933,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 15, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
15,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10933,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.15-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-linux_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12397,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz",
|
||||||
"zulu_version": [11, 45, 27, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-linux_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 10, 9]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
45,
|
||||||
|
27,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10667,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.1.3-ca-jdk12.0.0-linux_x64.tar.gz",
|
||||||
"zulu_version": [12, 1, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-linux_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 0, 33]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 33,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10710,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz",
|
||||||
"zulu_version": [12, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-linux_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 1, 12]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10780,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.3.11-ca-jdk12.0.2-linux_x64.tar.gz",
|
||||||
"zulu_version": [12, 3, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-linux_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 2, 3]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 3,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
3,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10846,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.27.9-ca-jdk13.0.0-linux_x64.tar.gz",
|
||||||
"zulu_version": [13, 27, 9, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-linux_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 0, 33]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 33,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
27,
|
||||||
|
9,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10888,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz",
|
||||||
"zulu_version": [13, 28, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-linux_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 1, 10]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
28,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11073,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.29.9-ca-jdk13.0.2-linux_x64.tar.gz",
|
||||||
"zulu_version": [13, 29, 9, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-linux_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 2, 6]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 6,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
29,
|
||||||
|
9,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12408,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.37.21-ca-jdk13.0.6-linux_x64.tar.gz",
|
||||||
"zulu_version": [13, 37, 21, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-linux_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 6, 5]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
6
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 5,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
37,
|
||||||
|
21,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11236,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.27.1-ca-jdk14.0.0-linux_x64.tar.gz",
|
||||||
"zulu_version": [14, 27, 1, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-linux_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 0, 36]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 36,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
27,
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11349,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.28.21-ca-jdk14.0.1-linux_x64.tar.gz",
|
||||||
"zulu_version": [14, 28, 21, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-linux_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 1, 8]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
28,
|
||||||
|
21,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11513,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.29.23-ca-jdk14.0.2-linux_x64.tar.gz",
|
||||||
"zulu_version": [14, 29, 23, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-linux_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 2, 12]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
29,
|
||||||
|
23,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11780,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz",
|
||||||
"zulu_version": [15, 27, 17, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-linux_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 0, 36]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 36,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
27,
|
||||||
|
17,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11924,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.28.13-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||||
"zulu_version": [15, 28, 13, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 1, 8]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
28,
|
||||||
|
13,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12101,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.28.51-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||||
"zulu_version": [15, 28, 51, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-linux_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 1, 9]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
28,
|
||||||
|
51,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12445,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.29.15-ca-jdk15.0.2-linux_x64.tar.gz",
|
||||||
"zulu_version": [15, 29, 15, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-linux_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 2, 7]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
29,
|
||||||
|
15,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12447,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
|
||||||
"zulu_version": [21, 32, 17, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu21.32.17-ca-jdk21.0.2-linux_aarch64.tar.gz",
|
||||||
"jdk_version": [21, 0, 2, 6]
|
"java_version": [
|
||||||
|
21,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 6,
|
||||||
|
"distro_version": [
|
||||||
|
21,
|
||||||
|
32,
|
||||||
|
17,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1,247 +1,667 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": 10996,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu1.8.0_05-8.1.0.10-macosx.tar.gz",
|
||||||
"zulu_version": [8, 1, 0, 10],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-macosx.tar.gz",
|
||||||
"jdk_version": [8, 0, 5, 13]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10997,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu1.8.0_11-8.2.0.1-macosx.tar.gz",
|
||||||
"zulu_version": [8, 2, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-macosx.tar.gz",
|
||||||
"jdk_version": [8, 0, 11, 12]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
11
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10346,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.21.0.1-jdk8.0.131-macosx_x64.tar.gz",
|
||||||
"zulu_version": [8, 21, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-macosx_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 131, 11]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
131
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 11,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
21,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10362,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.23.0.3-jdk8.0.144-macosx_x64.tar.gz",
|
||||||
"zulu_version": [8, 23, 0, 3],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-macosx_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 144, 1]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
144
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 1,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
23,
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10399,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.25.0.1-jdk8.0.152-macosx_x64.tar.gz",
|
||||||
"zulu_version": [8, 25, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-macosx_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 152, 16]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
152
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 16,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
25,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11355,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.46.0.19-ca-jdk8.0.252-macosx_x64.tar.gz",
|
||||||
"zulu_version": [8, 46, 0, 19],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-macosx_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 252, 14]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
252
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 14,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
46,
|
||||||
|
0,
|
||||||
|
19
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11481,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.47-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 47],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 17]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 17,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
47
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11622,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.51-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 51],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 19]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 19,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
51
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11535,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.49-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 49],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-macosx_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 18]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 18,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
49
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12424,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.52.0.23-ca-jdk8.0.282-macosx_x64.tar.gz",
|
||||||
"zulu_version": [8, 52, 0, 23],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-macosx_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 282, 8]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
282
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
52,
|
||||||
|
0,
|
||||||
|
23
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10383,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu9.0.0.15-jdk9.0.0-macosx_x64.tar.gz",
|
||||||
"zulu_version": [9, 0, 0, 15],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-macosx_x64.tar.gz",
|
||||||
"jdk_version": [9, 0, 0, 0]
|
"java_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 0,
|
||||||
|
"distro_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
15
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10413,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu9.0.1.3-jdk9.0.1-macosx_x64.tar.gz",
|
||||||
"zulu_version": [9, 0, 1, 3],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-macosx_x64.tar.gz",
|
||||||
"jdk_version": [9, 0, 1, 0]
|
"java_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 0,
|
||||||
|
"distro_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10503,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu10.2+3-jdk10.0.1-macosx_x64.tar.gz",
|
||||||
"zulu_version": [10, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-macosx_x64.tar.gz",
|
||||||
"jdk_version": [10, 0, 1, 9]
|
"java_version": [
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
10,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10541,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu10.3+5-jdk10.0.2-macosx_x64.tar.gz",
|
||||||
"zulu_version": [10, 3, 5, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-macosx_x64.tar.gz",
|
||||||
"jdk_version": [10, 0, 2, 13]
|
"java_version": [
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
10,
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10576,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz",
|
||||||
"zulu_version": [11, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 1, 13]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10604,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.29.3-ca-jdk11.0.2-macosx_x64.tar.gz",
|
||||||
"zulu_version": [11, 29, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-macosx_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 2, 7]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
29,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10687,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.31.11-ca-jdk11.0.3-macosx_x64.tar.gz",
|
||||||
"zulu_version": [11, 31, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-macosx_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 3, 7]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
31,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10856,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.13-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 13, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
13,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10933,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 15, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
15,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10933,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.15-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-macosx_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12397,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.45.27-ca-jdk11.0.10-macosx_x64.tar.gz",
|
||||||
"zulu_version": [11, 45, 27, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-macosx_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 10, 9]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
45,
|
||||||
|
27,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10667,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.1.3-ca-jdk12.0.0-macosx_x64.tar.gz",
|
||||||
"zulu_version": [12, 1, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-macosx_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 0, 33]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 33,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10710,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.2.3-ca-jdk12.0.1-macosx_x64.tar.gz",
|
||||||
"zulu_version": [12, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-macosx_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 1, 12]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10780,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.3.11-ca-jdk12.0.2-macosx_x64.tar.gz",
|
||||||
"zulu_version": [12, 3, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-macosx_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 2, 3]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 3,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
3,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10846,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.27.9-ca-jdk13.0.0-macosx_x64.tar.gz",
|
||||||
"zulu_version": [13, 27, 9, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-macosx_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 0, 33]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 33,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
27,
|
||||||
|
9,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10888,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.28.11-ca-jdk13.0.1-macosx_x64.tar.gz",
|
||||||
"zulu_version": [13, 28, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-macosx_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 1, 10]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
28,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11073,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.29.9-ca-jdk13.0.2-macosx_x64.tar.gz",
|
||||||
"zulu_version": [13, 29, 9, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-macosx_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 2, 6]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 6,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
29,
|
||||||
|
9,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12408,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.37.21-ca-jdk13.0.6-macosx_x64.tar.gz",
|
||||||
"zulu_version": [13, 37, 21, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-macosx_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 6, 5]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
6
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 5,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
37,
|
||||||
|
21,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11236,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.27.1-ca-jdk14.0.0-macosx_x64.tar.gz",
|
||||||
"zulu_version": [14, 27, 1, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-macosx_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 0, 36]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 36,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
27,
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11349,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.28.21-ca-jdk14.0.1-macosx_x64.tar.gz",
|
||||||
"zulu_version": [14, 28, 21, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-macosx_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 1, 8]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
28,
|
||||||
|
21,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11513,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.29.23-ca-jdk14.0.2-macosx_x64.tar.gz",
|
||||||
"zulu_version": [14, 29, 23, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-macosx_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 2, 12]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
29,
|
||||||
|
23,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11780,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.27.17-ca-jdk15.0.0-macosx_x64.tar.gz",
|
||||||
"zulu_version": [15, 27, 17, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-macosx_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 0, 36]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 36,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
27,
|
||||||
|
17,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11924,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.28.13-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||||
"zulu_version": [15, 28, 13, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 1, 8]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
28,
|
||||||
|
13,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12101,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.28.51-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||||
"zulu_version": [15, 28, 51, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-macosx_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 1, 9]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
28,
|
||||||
|
51,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12445,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.29.15-ca-jdk15.0.2-macosx_x64.tar.gz",
|
||||||
"zulu_version": [15, 29, 15, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-macosx_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 2, 7]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
29,
|
||||||
|
15,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
+577
-145
@@ -1,254 +1,686 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": 10996,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu1.8.0_05-8.1.0.10-windows.tar.gz",
|
||||||
"zulu_version": [8, 1, 0, 10],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_05-8.1.0.10-windows.tar.gz",
|
||||||
"jdk_version": [8, 0, 5, 13]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10997,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu1.8.0_11-8.2.0.1-windows.tar.gz",
|
||||||
"zulu_version": [8, 2, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu1.8.0_11-8.2.0.1-windows.tar.gz",
|
||||||
"jdk_version": [8, 0, 11, 12]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
11
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
2,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10346,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.21.0.1-jdk8.0.131-windows_x64.tar.gz",
|
||||||
"zulu_version": [8, 21, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.21.0.1-jdk8.0.131-windows_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 131, 11]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
131
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 11,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
21,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10362,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.23.0.3-jdk8.0.144-windows_x64.tar.gz",
|
||||||
"zulu_version": [8, 23, 0, 3],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.23.0.3-jdk8.0.144-windows_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 144, 1]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
144
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 1,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
23,
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10399,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.25.0.1-jdk8.0.152-windows_x64.tar.gz",
|
||||||
"zulu_version": [8, 25, 0, 1],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.25.0.1-jdk8.0.152-windows_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 152, 16]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
152
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 16,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
25,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11355,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.46.0.19-ca-jdk8.0.252-windows_x64.tar.gz",
|
||||||
"zulu_version": [8, 46, 0, 19],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.46.0.19-ca-jdk8.0.252-windows_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 252, 14]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
252
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 14,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
46,
|
||||||
|
0,
|
||||||
|
19
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11481,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.47-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 47],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.47-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 17]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 17,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
47
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11622,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.51-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 51],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.51-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 19]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 19,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
51
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11535,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.48.0.49-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||||
"zulu_version": [8, 48, 0, 49],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.48.0.49-ca-jdk8.0.262-windows_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 262, 18]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
262
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 18,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
48,
|
||||||
|
0,
|
||||||
|
49
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12424,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu8.52.0.23-ca-jdk8.0.282-windows_x64.tar.gz",
|
||||||
"zulu_version": [8, 52, 0, 23],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu8.52.0.23-ca-jdk8.0.282-windows_x64.tar.gz",
|
||||||
"jdk_version": [8, 0, 282, 8]
|
"java_version": [
|
||||||
|
8,
|
||||||
|
0,
|
||||||
|
282
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
8,
|
||||||
|
52,
|
||||||
|
0,
|
||||||
|
23
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10383,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu9.0.0.15-jdk9.0.0-windows_x64.tar.gz",
|
||||||
"zulu_version": [9, 0, 0, 15],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.0.15-jdk9.0.0-windows_x64.tar.gz",
|
||||||
"jdk_version": [9, 0, 0, 0]
|
"java_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 0,
|
||||||
|
"distro_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
15
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10413,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu9.0.1.3-jdk9.0.1-windows_x64.tar.gz",
|
||||||
"zulu_version": [9, 0, 1, 3],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu9.0.1.3-jdk9.0.1-windows_x64.tar.gz",
|
||||||
"jdk_version": [9, 0, 1, 0]
|
"java_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 0,
|
||||||
|
"distro_version": [
|
||||||
|
9,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10503,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu10.2+3-jdk10.0.1-windows_x64.tar.gz",
|
||||||
"zulu_version": [10, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.2+3-jdk10.0.1-windows_x64.tar.gz",
|
||||||
"jdk_version": [10, 0, 1, 9]
|
"java_version": [
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
10,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10541,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu10.3+5-jdk10.0.2-windows_x64.tar.gz",
|
||||||
"zulu_version": [10, 3, 5, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu10.3+5-jdk10.0.2-windows_x64.tar.gz",
|
||||||
"jdk_version": [10, 0, 2, 13]
|
"java_version": [
|
||||||
|
10,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
10,
|
||||||
|
3,
|
||||||
|
5,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10576,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.2.3-jdk11.0.1-windows_x64.tar.gz",
|
||||||
"zulu_version": [11, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-windows_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 1, 13]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 13,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10604,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.29.3-ca-jdk11.0.2-windows_x64.tar.gz",
|
||||||
"zulu_version": [11, 29, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.29.3-ca-jdk11.0.2-windows_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 2, 7]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
29,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10687,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.31.11-ca-jdk11.0.3-windows_x64.tar.gz",
|
||||||
"zulu_version": [11, 31, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.31.11-ca-jdk11.0.3-windows_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 3, 7]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
31,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10856,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.13-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 13, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.13-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
13,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10933,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 15, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
15,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10933,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.35.15-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||||
"zulu_version": [11, 35, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.35.11-ca-jdk11.0.5-windows_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 5, 10]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
5
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
35,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12397,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu11.45.27-ca-jdk11.0.10-windows_x64.tar.gz",
|
||||||
"zulu_version": [11, 45, 27, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-windows_x64.tar.gz",
|
||||||
"jdk_version": [11, 0, 10, 9]
|
"java_version": [
|
||||||
|
11,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
11,
|
||||||
|
45,
|
||||||
|
27,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10667,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.1.3-ca-jdk12.0.0-windows_x64.tar.gz",
|
||||||
"zulu_version": [12, 1, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.1.3-ca-jdk12.0.0-windows_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 0, 33]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 33,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10710,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.2.3-ca-jdk12.0.1-windows_x64.tar.gz",
|
||||||
"zulu_version": [12, 2, 3, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.2.3-ca-jdk12.0.1-windows_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 1, 12]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
2,
|
||||||
|
3,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10780,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu12.3.11-ca-jdk12.0.2-windows_x64.tar.gz",
|
||||||
"zulu_version": [12, 3, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu12.3.11-ca-jdk12.0.2-windows_x64.tar.gz",
|
||||||
"jdk_version": [12, 0, 2, 3]
|
"java_version": [
|
||||||
|
12,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 3,
|
||||||
|
"distro_version": [
|
||||||
|
12,
|
||||||
|
3,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10846,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.27.9-ca-jdk13.0.0-windows_x64.tar.gz",
|
||||||
"zulu_version": [13, 27, 9, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.27.9-ca-jdk13.0.0-windows_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 0, 33]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 33,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
27,
|
||||||
|
9,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 10888,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.28.11-ca-jdk13.0.1-windows_x64.tar.gz",
|
||||||
"zulu_version": [13, 28, 11, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.28.11-ca-jdk13.0.1-windows_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 1, 10]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 10,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
28,
|
||||||
|
11,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11073,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.29.9-ca-jdk13.0.2-windows_x64.tar.gz",
|
||||||
"zulu_version": [13, 29, 9, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.29.9-ca-jdk13.0.2-windows_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 2, 6]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 6,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
29,
|
||||||
|
9,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12408,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu13.37.21-ca-jdk13.0.6-windows_x64.tar.gz",
|
||||||
"zulu_version": [13, 37, 21, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu13.37.21-ca-jdk13.0.6-windows_x64.tar.gz",
|
||||||
"jdk_version": [13, 0, 6, 5]
|
"java_version": [
|
||||||
|
13,
|
||||||
|
0,
|
||||||
|
6
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 5,
|
||||||
|
"distro_version": [
|
||||||
|
13,
|
||||||
|
37,
|
||||||
|
21,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11236,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.27.1-ca-jdk14.0.0-windows_x64.tar.gz",
|
||||||
"zulu_version": [14, 27, 1, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.27.1-ca-jdk14.0.0-windows_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 0, 36]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 36,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
27,
|
||||||
|
1,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11349,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.28.21-ca-jdk14.0.1-windows_x64.tar.gz",
|
||||||
"zulu_version": [14, 28, 21, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.28.21-ca-jdk14.0.1-windows_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 1, 8]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
28,
|
||||||
|
21,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11513,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu14.29.23-ca-jdk14.0.2-windows_x64.tar.gz",
|
||||||
"zulu_version": [14, 29, 23, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu14.29.23-ca-jdk14.0.2-windows_x64.tar.gz",
|
||||||
"jdk_version": [14, 0, 2, 12]
|
"java_version": [
|
||||||
|
14,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 12,
|
||||||
|
"distro_version": [
|
||||||
|
14,
|
||||||
|
29,
|
||||||
|
23,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11780,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.27.17-ca-jdk15.0.0-windows_x64.tar.gz",
|
||||||
"zulu_version": [15, 27, 17, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.27.17-ca-jdk15.0.0-windows_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 0, 36]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 36,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
27,
|
||||||
|
17,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 11924,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.28.13-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||||
"zulu_version": [15, 28, 13, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.13-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 1, 8]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 8,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
28,
|
||||||
|
13,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12101,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.28.51-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||||
"zulu_version": [15, 28, 51, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.28.51-ca-jdk15.0.1-windows_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 1, 9]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 9,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
28,
|
||||||
|
51,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12445,
|
"package_uuid": "test-uuid-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",
|
"name": "zulu15.29.15-ca-jdk15.0.2-windows_x64.tar.gz",
|
||||||
"zulu_version": [15, 29, 15, 0],
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu15.29.15-ca-jdk15.0.2-windows_x64.tar.gz",
|
||||||
"jdk_version": [15, 0, 2, 7]
|
"java_version": [
|
||||||
|
15,
|
||||||
|
0,
|
||||||
|
2
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
15,
|
||||||
|
29,
|
||||||
|
15,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 12446,
|
"package_uuid": "test-uuid-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_aarch64.zip",
|
||||||
"name": "zulu17.48.15-ca-jdk17.0.10-win_aarch4.zip",
|
"download_url": "https://cdn.azul.com/zulu/bin/zulu17.48.15-ca-jdk17.0.10-windows_aarch64.zip",
|
||||||
"zulu_version": [17, 48, 15, 0],
|
"java_version": [
|
||||||
"jdk_version": [17, 0, 10, 7]
|
17,
|
||||||
|
0,
|
||||||
|
10
|
||||||
|
],
|
||||||
|
"openjdk_build_number": 7,
|
||||||
|
"distro_version": [
|
||||||
|
17,
|
||||||
|
48,
|
||||||
|
15,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latest": false,
|
||||||
|
"availability_type": "ca"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1,21 +1,59 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import {IAdoptAvailableVersions} from '../../src/distributions/adopt/models';
|
|
||||||
import {
|
import {
|
||||||
AdoptDistribution,
|
jest,
|
||||||
AdoptImplementation
|
describe,
|
||||||
} from '../../src/distributions/adopt/installer';
|
it,
|
||||||
import {TemurinDistribution} from '../../src/distributions/temurin/installer';
|
expect,
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
|
import {HttpClient} from '@actions/http-client';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import manifestData from '../data/adopt.json';
|
import manifestData from '../data/adopt.json' with {type: 'json'};
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
// 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';
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
let spyCoreWarning: jest.SpyInstance;
|
let spyCoreWarning: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -26,9 +64,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
spyCoreWarning = jest.spyOn(core, 'warning');
|
spyCoreWarning = core.warning as jest.Mock;
|
||||||
spyCoreWarning.mockImplementation(() => {});
|
spyCoreWarning.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -123,7 +161,7 @@ describe('getAvailableVersions', () => {
|
|||||||
'build correct url for %s',
|
'build correct url for %s',
|
||||||
async (
|
async (
|
||||||
installerOptions: JavaInstallerOptions,
|
installerOptions: JavaInstallerOptions,
|
||||||
impl: AdoptImplementation,
|
impl: AdoptImplementationType,
|
||||||
expectedParameters
|
expectedParameters
|
||||||
) => {
|
) => {
|
||||||
const distribution = new AdoptDistribution(installerOptions, impl);
|
const distribution = new AdoptDistribution(installerOptions, impl);
|
||||||
@@ -204,7 +242,7 @@ describe('getAvailableVersions', () => {
|
|||||||
[AdoptImplementation.OpenJ9, 'jre', 'Java_Adopt-OpenJ9_jre']
|
[AdoptImplementation.OpenJ9, 'jre', 'Java_Adopt-OpenJ9_jre']
|
||||||
])(
|
])(
|
||||||
'find right toolchain folder',
|
'find right toolchain folder',
|
||||||
(impl: AdoptImplementation, packageType: string, expected: string) => {
|
(impl: AdoptImplementationType, packageType: string, expected: string) => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{
|
||||||
version: '11',
|
version: '11',
|
||||||
@@ -263,11 +301,11 @@ describe('findPackageForDownload', () => {
|
|||||||
url: 'https://example.test/temurin-11.tar.gz'
|
url: 'https://example.test/temurin-11.tar.gz'
|
||||||
};
|
};
|
||||||
const temurinFindPackageForDownload = jest
|
const temurinFindPackageForDownload = jest
|
||||||
.fn()
|
.fn<any>()
|
||||||
.mockResolvedValue(temurinRelease);
|
.mockResolvedValue(temurinRelease);
|
||||||
const temurinDistribution = {
|
const temurinDistribution = {
|
||||||
findPackageForDownload: temurinFindPackageForDownload
|
findPackageForDownload: temurinFindPackageForDownload
|
||||||
} as unknown as TemurinDistribution;
|
} as any;
|
||||||
|
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{
|
||||||
@@ -279,7 +317,7 @@ describe('findPackageForDownload', () => {
|
|||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
temurinDistribution
|
temurinDistribution
|
||||||
);
|
);
|
||||||
const adoptLookupSpy = jest.fn();
|
const adoptLookupSpy = jest.fn<any>();
|
||||||
distribution['getAvailableVersions'] = adoptLookupSpy;
|
distribution['getAvailableVersions'] = adoptLookupSpy;
|
||||||
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload']('11');
|
const resolvedVersion = await distribution['findPackageForDownload']('11');
|
||||||
|
|||||||
@@ -1,19 +1,90 @@
|
|||||||
import * as tc from '@actions/tool-cache';
|
import {
|
||||||
import * as core from '@actions/core';
|
jest,
|
||||||
import * as util from '../../src/util';
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
|
import type {
|
||||||
|
JavaDownloadRelease,
|
||||||
|
JavaInstallerOptions,
|
||||||
|
JavaInstallerResults
|
||||||
|
} from '../../src/distributions/base-models.js';
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import * as semver from 'semver';
|
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';
|
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 {
|
class EmptyJavaBase extends JavaBase {
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
constructor(installerOptions: JavaInstallerOptions) {
|
||||||
super('Empty', installerOptions);
|
super('Empty', installerOptions);
|
||||||
@@ -53,12 +124,12 @@ describe('findInToolcache', () => {
|
|||||||
const javaPath = path.join('Java_Empty_jdk', actualJavaVersion, 'x64');
|
const javaPath = path.join('Java_Empty_jdk', actualJavaVersion, 'x64');
|
||||||
|
|
||||||
let mockJavaBase: EmptyJavaBase;
|
let mockJavaBase: EmptyJavaBase;
|
||||||
let spyGetToolcachePath: jest.SpyInstance;
|
let spyGetToolcachePath: any;
|
||||||
let spyTcFindAllVersions: jest.SpyInstance;
|
let spyTcFindAllVersions: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
spyGetToolcachePath = util.getToolcachePath as jest.Mock;
|
||||||
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -241,17 +312,17 @@ describe('setupJava', () => {
|
|||||||
|
|
||||||
let mockJavaBase: EmptyJavaBase;
|
let mockJavaBase: EmptyJavaBase;
|
||||||
|
|
||||||
let spyGetToolcachePath: jest.SpyInstance;
|
let spyGetToolcachePath: any;
|
||||||
let spyTcFindAllVersions: jest.SpyInstance;
|
let spyTcFindAllVersions: any;
|
||||||
let spyCoreDebug: jest.SpyInstance;
|
let spyCoreDebug: any;
|
||||||
let spyCoreInfo: jest.SpyInstance;
|
let spyCoreInfo: any;
|
||||||
let spyCoreExportVariable: jest.SpyInstance;
|
let spyCoreExportVariable: any;
|
||||||
let spyCoreAddPath: jest.SpyInstance;
|
let spyCoreAddPath: any;
|
||||||
let spyCoreSetOutput: jest.SpyInstance;
|
let spyCoreSetOutput: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
spyGetToolcachePath = util.getToolcachePath as jest.Mock;
|
||||||
spyGetToolcachePath.mockImplementation(
|
spyGetToolcachePath.mockImplementation(
|
||||||
(toolname: string, javaVersion: string, architecture: string) => {
|
(toolname: string, javaVersion: string, architecture: string) => {
|
||||||
const semverVersion = new semver.Range(javaVersion);
|
const semverVersion = new semver.Range(javaVersion);
|
||||||
@@ -269,27 +340,27 @@ describe('setupJava', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
|
||||||
spyTcFindAllVersions.mockReturnValue([installedJavaVersion]);
|
spyTcFindAllVersions.mockReturnValue([installedJavaVersion]);
|
||||||
|
|
||||||
// Spy on core methods
|
// Spy on core methods
|
||||||
spyCoreDebug = jest.spyOn(core, 'debug');
|
spyCoreDebug = core.debug as jest.Mock;
|
||||||
spyCoreDebug.mockImplementation(() => undefined);
|
spyCoreDebug.mockImplementation(() => undefined);
|
||||||
|
|
||||||
spyCoreInfo = jest.spyOn(core, 'info');
|
spyCoreInfo = core.info as jest.Mock;
|
||||||
spyCoreInfo.mockImplementation(() => undefined);
|
spyCoreInfo.mockImplementation(() => undefined);
|
||||||
|
|
||||||
spyCoreAddPath = jest.spyOn(core, 'addPath');
|
spyCoreAddPath = core.addPath as jest.Mock;
|
||||||
spyCoreAddPath.mockImplementation(() => undefined);
|
spyCoreAddPath.mockImplementation(() => undefined);
|
||||||
|
|
||||||
spyCoreExportVariable = jest.spyOn(core, 'exportVariable');
|
spyCoreExportVariable = core.exportVariable as jest.Mock;
|
||||||
spyCoreExportVariable.mockImplementation(() => undefined);
|
spyCoreExportVariable.mockImplementation(() => undefined);
|
||||||
|
|
||||||
spyCoreSetOutput = jest.spyOn(core, 'setOutput');
|
spyCoreSetOutput = core.setOutput as jest.Mock;
|
||||||
spyCoreSetOutput.mockImplementation(() => undefined);
|
spyCoreSetOutput.mockImplementation(() => undefined);
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => undefined);
|
spyCoreError.mockImplementation(() => undefined);
|
||||||
|
|
||||||
jest.spyOn(os, 'arch').mockReturnValue('x86' as ReturnType<typeof os.arch>);
|
jest.spyOn(os, 'arch').mockReturnValue('x86' as ReturnType<typeof os.arch>);
|
||||||
@@ -349,6 +420,29 @@ describe('setupJava', () => {
|
|||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith('Trying to download...');
|
expect(spyCoreInfo).not.toHaveBeenCalledWith('Trying to download...');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should resolve the latest version from remote when java-version is "latest", even if a version is cached', async () => {
|
||||||
|
mockJavaBase = new EmptyJavaBase({
|
||||||
|
version: 'latest',
|
||||||
|
architecture: 'x86',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
|
||||||
|
await expect(mockJavaBase.setupJava()).resolves.toEqual({
|
||||||
|
version: actualJavaVersion,
|
||||||
|
path: javaPathInstalled
|
||||||
|
});
|
||||||
|
|
||||||
|
// `latest` must bypass the tool-cache short-circuit and always resolve remotely
|
||||||
|
expect(spyCoreInfo).toHaveBeenCalledWith(
|
||||||
|
'Trying to resolve the latest version from remote'
|
||||||
|
);
|
||||||
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
||||||
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
|
`Resolved Java ${installedJavaVersion} from tool-cache`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -673,11 +767,18 @@ describe('normalizeVersion', () => {
|
|||||||
const DummyJavaBase = JavaBase as any;
|
const DummyJavaBase = JavaBase as any;
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['11', {version: '11', stable: true}],
|
['11', {version: '11', stable: true, latest: false}],
|
||||||
['11.0', {version: '11.0', stable: true}],
|
['11.0', {version: '11.0', stable: true, latest: false}],
|
||||||
['11.0.10', {version: '11.0.10', stable: true}],
|
['11.0.10', {version: '11.0.10', stable: true, latest: false}],
|
||||||
['11-ea', {version: '11', stable: false}],
|
['11-ea', {version: '11', stable: false, latest: false}],
|
||||||
['11.0.2-ea', {version: '11.0.2', stable: false}]
|
['11.0.2-ea', {version: '11.0.2', stable: false, latest: false}],
|
||||||
|
['18.0.1.1', {version: '18.0.1+1', stable: true, latest: false}],
|
||||||
|
['11.0.9.1', {version: '11.0.9+1', stable: true, latest: false}],
|
||||||
|
['12.0.2.1.0', {version: '12.0.2+1.0', stable: true, latest: false}],
|
||||||
|
['18.0.1.1-ea', {version: '18.0.1+1', stable: false, latest: false}],
|
||||||
|
['latest', {version: 'x', stable: true, latest: true}],
|
||||||
|
['LATEST', {version: 'x', stable: true, latest: true}],
|
||||||
|
[' Latest ', {version: 'x', stable: true, latest: true}]
|
||||||
])('normalizeVersion from %s to %s', (input, expected) => {
|
])('normalizeVersion from %s to %s', (input, expected) => {
|
||||||
expect(DummyJavaBase.prototype.normalizeVersion.call(null, input)).toEqual(
|
expect(DummyJavaBase.prototype.normalizeVersion.call(null, input)).toEqual(
|
||||||
expected
|
expected
|
||||||
@@ -692,6 +793,17 @@ describe('normalizeVersion', () => {
|
|||||||
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
|
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.each(['latest-ea', 'latest.1', 'LATEST-EA', ' latest-ea '])(
|
||||||
|
'normalizeVersion should throw a targeted error for latest combined with a qualifier (%s)',
|
||||||
|
version => {
|
||||||
|
expect(
|
||||||
|
DummyJavaBase.prototype.normalizeVersion.bind(null, version)
|
||||||
|
).toThrow(
|
||||||
|
`The 'latest' alias resolves stable (GA) releases only and cannot be combined with '-ea' or other qualifiers (received '${version}'). Use 'latest' on its own, or specify a concrete version.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('createVersionNotFoundError', () => {
|
describe('createVersionNotFoundError', () => {
|
||||||
|
|||||||
@@ -1,17 +1,62 @@
|
|||||||
|
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 {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 os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
import manifestData from '../data/corretto.json';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: ReturnType<typeof jest.spyOn>;
|
||||||
let spyGetDownloadArchiveExtension: jest.SpyInstance;
|
let spyGetDownloadArchiveExtension: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -20,13 +65,11 @@ describe('getAvailableVersions', () => {
|
|||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData
|
result: manifestData
|
||||||
});
|
});
|
||||||
spyGetDownloadArchiveExtension = jest.spyOn(
|
spyGetDownloadArchiveExtension =
|
||||||
util,
|
util.getDownloadArchiveExtension as jest.Mock;
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -161,6 +204,24 @@ describe('getAvailableVersions', () => {
|
|||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('with latest resolves to the newest available major version', async () => {
|
||||||
|
const distribution = new CorrettoDistribution({
|
||||||
|
version: 'latest',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
mockPlatform(distribution, 'linux');
|
||||||
|
|
||||||
|
const availableVersion =
|
||||||
|
await distribution['findPackageForDownload']('x');
|
||||||
|
expect(availableVersion).not.toBeNull();
|
||||||
|
// 18 is the newest major present in the mocked Corretto index
|
||||||
|
expect(availableVersion.url).toBe(
|
||||||
|
'https://corretto.aws/downloads/resources/18.0.0.37.1/amazon-corretto-18.0.0.37.1-linux-x64.tar.gz'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('with unstable version expect to throw not supported error', async () => {
|
it('with unstable version expect to throw not supported error', async () => {
|
||||||
const version = '18.0.1-ea';
|
const version = '18.0.1-ea';
|
||||||
const distribution = new CorrettoDistribution({
|
const distribution = new CorrettoDistribution({
|
||||||
@@ -235,7 +296,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const mockPlatform = (
|
const mockPlatform = (
|
||||||
distribution: CorrettoDistribution,
|
distribution: InstanceType<typeof CorrettoDistribution>,
|
||||||
platform: string
|
platform: string
|
||||||
) => {
|
) => {
|
||||||
distribution['getPlatformOption'] = () => platform;
|
distribution['getPlatformOption'] = () => platform;
|
||||||
|
|||||||
@@ -1,14 +1,59 @@
|
|||||||
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
import {HttpClient} from '@actions/http-client';
|
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';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
let spyUtilGetDownloadArchiveExtension: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -18,14 +63,12 @@ describe('getAvailableVersions', () => {
|
|||||||
result: manifestData
|
result: manifestData
|
||||||
});
|
});
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
spyUtilGetDownloadArchiveExtension =
|
||||||
utils,
|
utils.getDownloadArchiveExtension as jest.Mock;
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -36,7 +79,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const mockPlatform = (
|
const mockPlatform = (
|
||||||
distribution: DragonwellDistribution,
|
distribution: InstanceType<typeof DragonwellDistribution>,
|
||||||
platform: string
|
platform: string
|
||||||
) => {
|
) => {
|
||||||
distribution['getPlatformOption'] = () => platform;
|
distribution['getPlatformOption'] = () => platform;
|
||||||
|
|||||||
@@ -1,53 +1,116 @@
|
|||||||
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 {
|
import {
|
||||||
GraalVMCommunityDistribution,
|
jest,
|
||||||
GraalVMDistribution
|
describe,
|
||||||
} from '../../src/distributions/graalvm/installer';
|
it,
|
||||||
import {getJavaDistribution} from '../../src/distributions/distribution-factory';
|
expect,
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
beforeEach,
|
||||||
import * as util from '../../src/util';
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
jest.mock('@actions/core');
|
// Mock @actions modules
|
||||||
jest.mock('@actions/tool-cache');
|
jest.unstable_mockModule('@actions/core', () => ({
|
||||||
jest.mock('@actions/http-client');
|
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('../../src/util', () => ({
|
jest.unstable_mockModule('@actions/tool-cache', () => ({
|
||||||
...jest.requireActual('../../src/util'),
|
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,
|
||||||
extractJdkFile: jest.fn(),
|
extractJdkFile: jest.fn(),
|
||||||
getDownloadArchiveExtension: jest.fn(),
|
getDownloadArchiveExtension: jest.fn(),
|
||||||
renameWinArchive: jest.fn(),
|
renameWinArchive: jest.fn(),
|
||||||
getGitHubHttpHeaders: jest.fn().mockReturnValue({Accept: 'application/json'})
|
getGitHubHttpHeaders: jest.fn().mockReturnValue({Accept: 'application/json'})
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.mock('fs', () => ({
|
const real_fs_module = await import('fs');
|
||||||
...jest.requireActual('fs'),
|
jest.unstable_mockModule('fs', () => ({
|
||||||
|
...real_fs_module,
|
||||||
|
default: {
|
||||||
|
...real_fs_module.default,
|
||||||
|
readdirSync: jest.fn(),
|
||||||
|
existsSync: jest.fn()
|
||||||
|
},
|
||||||
readdirSync: jest.fn(),
|
readdirSync: jest.fn(),
|
||||||
existsSync: 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(() => {
|
beforeAll(() => {
|
||||||
process.env.NODE_ENV = 'test';
|
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');
|
console.log('✅ All external dependencies are properly mocked');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('GraalVMDistribution', () => {
|
describe('GraalVMDistribution', () => {
|
||||||
let distribution: GraalVMDistribution;
|
let distribution: InstanceType<typeof GraalVMDistribution>;
|
||||||
let communityDistribution: GraalVMCommunityDistribution;
|
let communityDistribution: InstanceType<typeof GraalVMCommunityDistribution>;
|
||||||
let mockHttpClient: jest.Mocked<http.HttpClient>;
|
let mockHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
const defaultOptions: JavaInstallerOptions = {
|
const defaultOptions: JavaInstallerOptions = {
|
||||||
version: '17',
|
version: '17',
|
||||||
@@ -62,23 +125,20 @@ describe('GraalVMDistribution', () => {
|
|||||||
distribution = new GraalVMDistribution(defaultOptions);
|
distribution = new GraalVMDistribution(defaultOptions);
|
||||||
communityDistribution = new GraalVMCommunityDistribution(defaultOptions);
|
communityDistribution = new GraalVMCommunityDistribution(defaultOptions);
|
||||||
|
|
||||||
mockHttpClient = new http.HttpClient() as jest.Mocked<http.HttpClient>;
|
mockHttpClient = new (http.HttpClient as any)();
|
||||||
(distribution as any).http = mockHttpClient;
|
(distribution as any).http = mockHttpClient;
|
||||||
(communityDistribution as any).http = mockHttpClient;
|
(communityDistribution as any).http = mockHttpClient;
|
||||||
|
|
||||||
(util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('tar.gz');
|
(util.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||||
|
'tar.gz'
|
||||||
|
);
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
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.restoreAllMocks();
|
||||||
jest.clearAllMocks();
|
jest.clearAllMocks();
|
||||||
});
|
});
|
||||||
@@ -113,20 +173,24 @@ describe('GraalVMDistribution', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
(tc.downloadTool as jest.Mock).mockResolvedValue('/tmp/archive.tar.gz');
|
(tc.downloadTool as any).mockResolvedValue('/tmp/archive.tar.gz');
|
||||||
(tc.cacheDir as jest.Mock).mockResolvedValue('/cached/java/path');
|
(tc.cacheDir as any).mockResolvedValue('/cached/java/path');
|
||||||
|
|
||||||
(util.extractJdkFile as jest.Mock).mockResolvedValue('/tmp/extracted');
|
(util.extractJdkFile as any).mockResolvedValue('/tmp/extracted');
|
||||||
|
|
||||||
// Mock renameWinArchive - it returns the same path (no renaming)
|
// Mock renameWinArchive - it returns the same path (no renaming)
|
||||||
(util.renameWinArchive as jest.Mock).mockImplementation((p: string) => p);
|
(util.renameWinArchive as any).mockImplementation((p: string) => p);
|
||||||
|
|
||||||
(util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('tar.gz');
|
(util.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||||
|
'tar.gz'
|
||||||
|
);
|
||||||
|
|
||||||
// Mock fs.existsSync to return true for extracted path
|
// Mock fs.existsSync to return true for extracted path
|
||||||
(fs.existsSync as jest.Mock).mockReturnValue(true);
|
(fs.existsSync as jest.Mock<any>).mockReturnValue(true);
|
||||||
|
|
||||||
(fs.readdirSync as jest.Mock).mockReturnValue(['graalvm-jdk-17.0.5']);
|
(fs.readdirSync as jest.Mock<any>).mockReturnValue([
|
||||||
|
'graalvm-jdk-17.0.5'
|
||||||
|
]);
|
||||||
|
|
||||||
jest
|
jest
|
||||||
.spyOn(distribution as any, 'getToolcacheVersionName')
|
.spyOn(distribution as any, 'getToolcacheVersionName')
|
||||||
@@ -173,7 +237,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should throw error when extracted path does not exist', async () => {
|
it('should throw error when extracted path does not exist', async () => {
|
||||||
(fs.existsSync as jest.Mock).mockReturnValue(false);
|
(fs.existsSync as jest.Mock<any>).mockReturnValue(false);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
(distribution as any).downloadTool(javaRelease)
|
(distribution as any).downloadTool(javaRelease)
|
||||||
@@ -187,8 +251,8 @@ describe('GraalVMDistribution', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should throw error when extracted directory is empty', async () => {
|
it('should throw error when extracted directory is empty', async () => {
|
||||||
(fs.existsSync as jest.Mock).mockReturnValue(true);
|
(fs.existsSync as jest.Mock<any>).mockReturnValue(true);
|
||||||
(fs.readdirSync as jest.Mock).mockReturnValue([]);
|
(fs.readdirSync as jest.Mock<any>).mockReturnValue([]);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
(distribution as any).downloadTool(javaRelease)
|
(distribution as any).downloadTool(javaRelease)
|
||||||
@@ -203,7 +267,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
|
|
||||||
it('should handle download errors', async () => {
|
it('should handle download errors', async () => {
|
||||||
const downloadError = new Error('Network error during download');
|
const downloadError = new Error('Network error during download');
|
||||||
(tc.downloadTool as jest.Mock).mockRejectedValue(downloadError);
|
(tc.downloadTool as any).mockRejectedValue(downloadError);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
(distribution as any).downloadTool(javaRelease)
|
(distribution as any).downloadTool(javaRelease)
|
||||||
@@ -216,7 +280,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
|
|
||||||
it('should handle extraction errors', async () => {
|
it('should handle extraction errors', async () => {
|
||||||
const extractError = new Error('Failed to extract archive');
|
const extractError = new Error('Failed to extract archive');
|
||||||
(util.extractJdkFile as jest.Mock).mockRejectedValue(extractError);
|
(util.extractJdkFile as any).mockRejectedValue(extractError);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
(distribution as any).downloadTool(javaRelease)
|
(distribution as any).downloadTool(javaRelease)
|
||||||
@@ -229,8 +293,10 @@ describe('GraalVMDistribution', () => {
|
|||||||
|
|
||||||
it('should handle different archive extensions', async () => {
|
it('should handle different archive extensions', async () => {
|
||||||
// Test with a .zip file
|
// Test with a .zip file
|
||||||
(util.getDownloadArchiveExtension as jest.Mock).mockReturnValue('zip');
|
(util.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||||
(tc.downloadTool as jest.Mock).mockResolvedValue('/tmp/archive.zip');
|
'zip'
|
||||||
|
);
|
||||||
|
(tc.downloadTool as any).mockResolvedValue('/tmp/archive.zip');
|
||||||
|
|
||||||
const zipRelease = {
|
const zipRelease = {
|
||||||
version: '17.0.5',
|
version: '17.0.5',
|
||||||
@@ -309,7 +375,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
it('should construct correct URL for specific version', async () => {
|
it('should construct correct URL for specific version', async () => {
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
message: {statusCode: 200}
|
message: {statusCode: 200}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
const result = await (distribution as any).findPackageForDownload(
|
const result = await (distribution as any).findPackageForDownload(
|
||||||
@@ -326,7 +392,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
it('should construct correct URL for major version (latest)', async () => {
|
it('should construct correct URL for major version (latest)', async () => {
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
message: {statusCode: 200}
|
message: {statusCode: 200}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
const result = await (distribution as any).findPackageForDownload('21');
|
const result = await (distribution as any).findPackageForDownload('21');
|
||||||
@@ -351,6 +417,61 @@ describe('GraalVMDistribution', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('latest alias', () => {
|
||||||
|
it('resolves the newest major version from the Adoptium API', async () => {
|
||||||
|
const latestDistribution = new GraalVMDistribution({
|
||||||
|
...defaultOptions,
|
||||||
|
version: 'latest'
|
||||||
|
});
|
||||||
|
(latestDistribution as any).http = mockHttpClient;
|
||||||
|
jest
|
||||||
|
.spyOn(latestDistribution, 'getPlatform')
|
||||||
|
.mockReturnValue('linux');
|
||||||
|
mockHttpClient.getJson.mockResolvedValue({
|
||||||
|
statusCode: 200,
|
||||||
|
result: {most_recent_feature_release: 25},
|
||||||
|
headers: {}
|
||||||
|
});
|
||||||
|
mockHttpClient.head.mockResolvedValue({
|
||||||
|
message: {statusCode: 200}
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await (
|
||||||
|
latestDistribution as any
|
||||||
|
).findPackageForDownload('x');
|
||||||
|
|
||||||
|
expect(result).toEqual({
|
||||||
|
url: 'https://download.oracle.com/graalvm/25/latest/graalvm-jdk-25_linux-x64_bin.tar.gz',
|
||||||
|
version: '25'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('throws an actionable error when the latest major is not yet available', async () => {
|
||||||
|
const latestDistribution = new GraalVMDistribution({
|
||||||
|
...defaultOptions,
|
||||||
|
version: 'latest'
|
||||||
|
});
|
||||||
|
(latestDistribution as any).http = mockHttpClient;
|
||||||
|
jest
|
||||||
|
.spyOn(latestDistribution, 'getPlatform')
|
||||||
|
.mockReturnValue('linux');
|
||||||
|
mockHttpClient.getJson.mockResolvedValue({
|
||||||
|
statusCode: 200,
|
||||||
|
result: {most_recent_feature_release: 25},
|
||||||
|
headers: {}
|
||||||
|
});
|
||||||
|
mockHttpClient.head.mockResolvedValue({
|
||||||
|
message: {statusCode: 404}
|
||||||
|
});
|
||||||
|
|
||||||
|
await expect(
|
||||||
|
(latestDistribution as any).findPackageForDownload('x')
|
||||||
|
).rejects.toThrow(
|
||||||
|
/is not yet available for the GraalVM distribution/
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should throw error for JDK versions less than 17', async () => {
|
it('should throw error for JDK versions less than 17', async () => {
|
||||||
await expect(
|
await expect(
|
||||||
(distribution as any).findPackageForDownload('11')
|
(distribution as any).findPackageForDownload('11')
|
||||||
@@ -374,7 +495,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
it('should throw error when file not found (404)', async () => {
|
it('should throw error when file not found (404)', async () => {
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
message: {statusCode: 404}
|
message: {statusCode: 404}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
// Verify the error is thrown with the expected message
|
// Verify the error is thrown with the expected message
|
||||||
@@ -395,7 +516,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
it('should throw error for unauthorized access (401)', async () => {
|
it('should throw error for unauthorized access (401)', async () => {
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
message: {statusCode: 401}
|
message: {statusCode: 401}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
@@ -408,7 +529,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
it('should throw error for forbidden access (403)', async () => {
|
it('should throw error for forbidden access (403)', async () => {
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
message: {statusCode: 403}
|
message: {statusCode: 403}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
@@ -424,7 +545,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
statusCode: 500,
|
statusCode: 500,
|
||||||
statusMessage: 'Internal Server Error'
|
statusMessage: 'Internal Server Error'
|
||||||
}
|
}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
@@ -437,7 +558,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
it('should throw error for other HTTP errors without status message', async () => {
|
it('should throw error for other HTTP errors without status message', async () => {
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
message: {statusCode: 500}
|
message: {statusCode: 500}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
await expect(
|
await expect(
|
||||||
@@ -713,7 +834,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
let fetchEASpy: jest.SpyInstance;
|
let fetchEASpy: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
fetchEASpy = jest.spyOn(distribution as any, 'fetchEAJson');
|
fetchEASpy = jest.spyOn(distribution as any, 'fetchEAJson');
|
||||||
@@ -932,7 +1053,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
|
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
message: {statusCode: 200}
|
message: {statusCode: 200}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
const result = await (distribution as any).findPackageForDownload('17');
|
const result = await (distribution as any).findPackageForDownload('17');
|
||||||
@@ -960,7 +1081,7 @@ describe('GraalVMDistribution', () => {
|
|||||||
|
|
||||||
const mockResponse = {
|
const mockResponse = {
|
||||||
message: {statusCode: 200}
|
message: {statusCode: 200}
|
||||||
} as http.HttpClientResponse;
|
} as any;
|
||||||
mockHttpClient.head.mockResolvedValue(mockResponse);
|
mockHttpClient.head.mockResolvedValue(mockResponse);
|
||||||
|
|
||||||
const result = await (distribution as any).findPackageForDownload('17');
|
const result = await (distribution as any).findPackageForDownload('17');
|
||||||
@@ -1049,6 +1170,60 @@ describe('GraalVMDistribution', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('resolves latest to the newest GA across all Community majors without calling Adoptium', async () => {
|
||||||
|
const latestCommunity = new GraalVMCommunityDistribution({
|
||||||
|
...defaultOptions,
|
||||||
|
version: 'latest'
|
||||||
|
});
|
||||||
|
(latestCommunity as any).http = mockHttpClient;
|
||||||
|
jest.spyOn(latestCommunity, 'getPlatform').mockReturnValue('linux');
|
||||||
|
|
||||||
|
mockHttpClient.getJson.mockResolvedValue({
|
||||||
|
result: [
|
||||||
|
{
|
||||||
|
draft: false,
|
||||||
|
prerelease: false,
|
||||||
|
assets: [
|
||||||
|
{
|
||||||
|
name: 'graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz',
|
||||||
|
browser_download_url:
|
||||||
|
'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-x64_bin.tar.gz'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
draft: false,
|
||||||
|
prerelease: false,
|
||||||
|
assets: [
|
||||||
|
{
|
||||||
|
name: 'graalvm-community-jdk-24.0.1_linux-x64_bin.tar.gz',
|
||||||
|
browser_download_url:
|
||||||
|
'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-24.0.1/graalvm-community-jdk-24.0.1_linux-x64_bin.tar.gz'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
statusCode: 200,
|
||||||
|
headers: {}
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await (latestCommunity as any).findPackageForDownload(
|
||||||
|
'x'
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(result).toEqual({
|
||||||
|
url: 'https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-24.0.1/graalvm-community-jdk-24.0.1_linux-x64_bin.tar.gz',
|
||||||
|
version: '24.0.1'
|
||||||
|
});
|
||||||
|
// The Community release list is authoritative, so the Adoptium
|
||||||
|
// most_recent_feature_release endpoint must not be consulted.
|
||||||
|
expect(mockHttpClient.getJson).toHaveBeenCalledTimes(1);
|
||||||
|
expect(mockHttpClient.getJson).toHaveBeenCalledWith(
|
||||||
|
expect.stringContaining('graalvm-ce-builds/releases'),
|
||||||
|
expect.anything()
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('should reject GraalVM Community early access requests', async () => {
|
it('should reject GraalVM Community early access requests', async () => {
|
||||||
(communityDistribution as any).stable = false;
|
(communityDistribution as any).stable = false;
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,53 @@
|
|||||||
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
import https from 'https';
|
import https from 'https';
|
||||||
import {HttpClient} from '@actions/http-client';
|
import {HttpClient} from '@actions/http-client';
|
||||||
import {JetBrainsDistribution} from '../../src/distributions/jetbrains/installer';
|
|
||||||
|
|
||||||
import manifestData from '../data/jetbrains.json';
|
import manifestData from '../data/jetbrains.json' with {type: 'json'};
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
// 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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -19,7 +58,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -31,10 +70,16 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
it('load available versions', async () => {
|
it('load available versions', async () => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
spyHttpClient.mockReturnValueOnce({
|
spyHttpClient
|
||||||
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as any
|
result: manifestData as any
|
||||||
|
})
|
||||||
|
.mockReturnValue({
|
||||||
|
statusCode: 200,
|
||||||
|
headers: {},
|
||||||
|
result: []
|
||||||
});
|
});
|
||||||
|
|
||||||
const distribution = new JetBrainsDistribution({
|
const distribution = new JetBrainsDistribution({
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {KonaDistribution} from '../../src/distributions/kona/installer';
|
import {KonaDistribution} from '../../src/distributions/kona/installer.js';
|
||||||
|
|
||||||
import manifestData from '../data/kona.json';
|
import manifestData from '../data/kona.json' with {type: 'json'};
|
||||||
|
|
||||||
function mockDistr(
|
function mockDistr(
|
||||||
version: string,
|
version: string,
|
||||||
@@ -28,7 +28,9 @@ describe('Check getAvailableReleases', () => {
|
|||||||
['11', 'linux', 'x86_64', 'linux-x86_64'],
|
['11', 'linux', 'x86_64', 'linux-x86_64'],
|
||||||
['11.0.25', 'macos', 'aarch64', 'macosx-aarch64'],
|
['11.0.25', 'macos', 'aarch64', 'macosx-aarch64'],
|
||||||
['17.0.13', 'windows', 'x86_64', 'windows-x86_64'],
|
['17.0.13', 'windows', 'x86_64', 'windows-x86_64'],
|
||||||
['21.0.5', 'linux', 'x86_64', 'linux-x86_64']
|
['21.0.5', 'linux', 'x86_64', 'linux-x86_64'],
|
||||||
|
['25', 'linux', 'aarch64', 'linux-aarch64'],
|
||||||
|
['25.0.3', 'macos', 'x86_64', 'macosx-x86_64']
|
||||||
])(
|
])(
|
||||||
'should get releases with the specified version "%s", OS "%s" and arch "%s"',
|
'should get releases with the specified version "%s", OS "%s" and arch "%s"',
|
||||||
async (
|
async (
|
||||||
@@ -41,7 +43,7 @@ describe('Check getAvailableReleases', () => {
|
|||||||
|
|
||||||
const releases = await distribution['getAvailableReleases']();
|
const releases = await distribution['getAvailableReleases']();
|
||||||
expect(releases).not.toBeNull();
|
expect(releases).not.toBeNull();
|
||||||
expect(releases.length).toBe(4);
|
expect(releases.length).toBe(5);
|
||||||
releases.forEach(release =>
|
releases.forEach(release =>
|
||||||
expect(release.downloadUrl).toContain(expectedPattern)
|
expect(release.downloadUrl).toContain(expectedPattern)
|
||||||
);
|
);
|
||||||
@@ -173,6 +175,37 @@ describe('Check findPackageForDownload', () => {
|
|||||||
'windows',
|
'windows',
|
||||||
'x86_64',
|
'x86_64',
|
||||||
'https://github.com/Tencent/TencentKona-21/releases/download/TencentKona-21.0.5/TencentKona-21.0.5.b1_jdk_windows-x86_64_signed.zip'
|
'https://github.com/Tencent/TencentKona-21/releases/download/TencentKona-21.0.5/TencentKona-21.0.5.b1_jdk_windows-x86_64_signed.zip'
|
||||||
|
],
|
||||||
|
|
||||||
|
[
|
||||||
|
'25',
|
||||||
|
'linux',
|
||||||
|
'aarch64',
|
||||||
|
'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1-jdk_linux-aarch64.tar.gz'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'25.0.3',
|
||||||
|
'linux',
|
||||||
|
'x86_64',
|
||||||
|
'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1-jdk_linux-x86_64.tar.gz'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'25.0.3',
|
||||||
|
'macos',
|
||||||
|
'aarch64',
|
||||||
|
'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1_jdk_macosx-aarch64_notarized.tar.gz'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'25.0.3',
|
||||||
|
'macos',
|
||||||
|
'x86_64',
|
||||||
|
'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1_jdk_macosx-x86_64_notarized.tar.gz'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'25.0.3',
|
||||||
|
'windows',
|
||||||
|
'x86_64',
|
||||||
|
'https://github.com/Tencent/TencentKona-25/releases/download/TencentKona-25.0.3/TencentKona-25.0.3.b1_jdk_windows-x86_64_signed.zip'
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
'should return the download URL with the specified version "%s", OS "%s" and arch "%s"',
|
'should return the download URL with the specified version "%s", OS "%s" and arch "%s"',
|
||||||
|
|||||||
@@ -1,17 +1,56 @@
|
|||||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
|
||||||
import {
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
|
import type {
|
||||||
ArchitectureOptions,
|
ArchitectureOptions,
|
||||||
LibericaVersion
|
LibericaVersion
|
||||||
} from '../../src/distributions/liberica/models';
|
} from '../../src/distributions/liberica/models.js';
|
||||||
import {HttpClient} from '@actions/http-client';
|
import {HttpClient} from '@actions/http-client';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
import manifestData from '../data/liberica.json';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -22,7 +61,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -184,7 +223,7 @@ describe('getArchitectureOptions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
describe('findPackageForDownload', () => {
|
||||||
let distribution: LibericaDistributions;
|
let distribution: InstanceType<typeof LibericaDistributions>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
distribution = new LibericaDistributions({
|
distribution = new LibericaDistributions({
|
||||||
|
|||||||
@@ -1,17 +1,56 @@
|
|||||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
|
||||||
import {
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
|
import type {
|
||||||
ArchitectureOptions,
|
ArchitectureOptions,
|
||||||
LibericaVersion
|
LibericaVersion
|
||||||
} from '../../src/distributions/liberica/models';
|
} from '../../src/distributions/liberica/models.js';
|
||||||
import {HttpClient} from '@actions/http-client';
|
import {HttpClient} from '@actions/http-client';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
import manifestData from '../data/liberica-linux.json';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -22,7 +61,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -184,7 +223,7 @@ describe('getArchitectureOptions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
describe('findPackageForDownload', () => {
|
||||||
let distribution: LibericaDistributions;
|
let distribution: InstanceType<typeof LibericaDistributions>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
distribution = new LibericaDistributions({
|
distribution = new LibericaDistributions({
|
||||||
|
|||||||
@@ -0,0 +1,219 @@
|
|||||||
|
import {jest, describe, it, expect, beforeEach, afterEach} from '@jest/globals';
|
||||||
|
import type {
|
||||||
|
ArchitectureOptions,
|
||||||
|
NikVersion
|
||||||
|
} from '../../src/distributions/liberica-nik/models.js';
|
||||||
|
import {HttpClient} from '@actions/http-client';
|
||||||
|
|
||||||
|
import manifestData from '../data/liberica-nik.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 {LibericaNikDistributions} =
|
||||||
|
await import('../../src/distributions/liberica-nik/installer.js');
|
||||||
|
|
||||||
|
const ADDITIONAL_PARAMS =
|
||||||
|
'&installation-type=archive&fields=downloadUrl%2Cversion%2Ccomponents%2Ccomponent%2Cembedded';
|
||||||
|
|
||||||
|
describe('getAvailableVersions', () => {
|
||||||
|
let spyHttpClient: any;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
|
spyHttpClient.mockReturnValue({
|
||||||
|
statusCode: 200,
|
||||||
|
headers: {},
|
||||||
|
result: manifestData as NikVersion[]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.resetAllMocks();
|
||||||
|
jest.clearAllMocks();
|
||||||
|
jest.restoreAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
[
|
||||||
|
{version: '21', architecture: 'x64', packageType: 'jdk'},
|
||||||
|
'bundle-type=standard&bitness=64&arch=x86&build-type=all'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{version: '21-ea', architecture: 'x64', packageType: 'jdk'},
|
||||||
|
'bundle-type=standard&bitness=64&arch=x86&build-type=ea'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{version: '21', architecture: 'aarch64', packageType: 'jdk'},
|
||||||
|
'bundle-type=standard&bitness=64&arch=arm&build-type=all'
|
||||||
|
],
|
||||||
|
[
|
||||||
|
{version: '21', architecture: 'x64', packageType: 'jdk+fx'},
|
||||||
|
'bundle-type=full&bitness=64&arch=x86&build-type=all'
|
||||||
|
]
|
||||||
|
])('build correct url for %s -> %s', async (input, urlParams) => {
|
||||||
|
const distribution = new LibericaNikDistributions({
|
||||||
|
...input,
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
distribution['getPlatformOption'] = () => 'linux';
|
||||||
|
const buildUrl = `https://api.bell-sw.com/v1/nik/releases?os=linux&${urlParams}${ADDITIONAL_PARAMS}`;
|
||||||
|
|
||||||
|
await distribution['getAvailableVersions']();
|
||||||
|
|
||||||
|
expect(spyHttpClient.mock.calls).toHaveLength(1);
|
||||||
|
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('load available versions', async () => {
|
||||||
|
const distribution = new LibericaNikDistributions({
|
||||||
|
version: '21',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
const availableVersions = await distribution['getAvailableVersions']();
|
||||||
|
expect(availableVersions).toEqual(manifestData);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getArchitectureOptions', () => {
|
||||||
|
it.each([
|
||||||
|
['x64', {bitness: '64', arch: 'x86'}],
|
||||||
|
['aarch64', {bitness: '64', arch: 'arm'}]
|
||||||
|
] as [string, ArchitectureOptions][])(
|
||||||
|
'parse architecture %s -> %s',
|
||||||
|
(input, expected) => {
|
||||||
|
const distributions = new LibericaNikDistributions({
|
||||||
|
architecture: input,
|
||||||
|
checkLatest: false,
|
||||||
|
packageType: 'jdk',
|
||||||
|
version: '21'
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(distributions['getArchitectureOptions']()).toEqual(expected);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
it.each(['x86', 'armv7', 's390x'])('not support architecture %s', input => {
|
||||||
|
const distributions = new LibericaNikDistributions({
|
||||||
|
architecture: input,
|
||||||
|
checkLatest: false,
|
||||||
|
packageType: 'jdk',
|
||||||
|
version: '21'
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(() => distributions['getArchitectureOptions']()).toThrow(
|
||||||
|
/Architecture '\w+' is not supported\. Supported architectures: .*/
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('findPackageForDownload', () => {
|
||||||
|
let distribution: InstanceType<typeof LibericaNikDistributions>;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
distribution = new LibericaNikDistributions({
|
||||||
|
version: '',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
|
});
|
||||||
|
|
||||||
|
// The user's java-version resolves against the embedded JDK version, not
|
||||||
|
// NIK's own GraalVM version.
|
||||||
|
it.each([
|
||||||
|
['21', '21.0.11+12'],
|
||||||
|
['17', '17.0.19+12'],
|
||||||
|
['25', '25.0.3+12'],
|
||||||
|
['11', '11.0.22+12'],
|
||||||
|
['21.0.2', '21.0.2+14'],
|
||||||
|
['23', '23.0.2+9'],
|
||||||
|
['20.x', '20.0.2+10'],
|
||||||
|
['25.0.1', '25.0.1+16']
|
||||||
|
])('version is %s -> %s', async (input, expected) => {
|
||||||
|
const result = await distribution['findPackageForDownload'](input);
|
||||||
|
expect(result.version).toBe(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should throw an error', async () => {
|
||||||
|
await expect(distribution['findPackageForDownload']('7')).rejects.toThrow(
|
||||||
|
/No matching version found for SemVer/
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('getPlatformOption', () => {
|
||||||
|
const distributions = new LibericaNikDistributions({
|
||||||
|
architecture: 'x64',
|
||||||
|
version: '21',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
['linux', 'linux'],
|
||||||
|
['darwin', 'macos'],
|
||||||
|
['win32', 'windows'],
|
||||||
|
['cygwin', 'windows']
|
||||||
|
])('os version %s -> %s', (input, expected) => {
|
||||||
|
const actual = distributions['getPlatformOption'](input as NodeJS.Platform);
|
||||||
|
|
||||||
|
expect(actual).toEqual(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each(['sunos', 'aix', 'android', 'freebsd'])(
|
||||||
|
'not support os version %s',
|
||||||
|
input => {
|
||||||
|
expect(() =>
|
||||||
|
distributions['getPlatformOption'](input as NodeJS.Platform)
|
||||||
|
).toThrow(/Platform '\w+' is not supported\. Supported platforms: .+/);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('convertVersionToSemver', () => {
|
||||||
|
const distributions = new LibericaNikDistributions({
|
||||||
|
architecture: 'x64',
|
||||||
|
version: '21',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each([
|
||||||
|
['25.0.1+16', '25.0.1+16'],
|
||||||
|
['21+37', '21.0.0+37'],
|
||||||
|
['23+38', '23.0.0+38'],
|
||||||
|
['11.0.15.1+2', '11.0.15+1.2'],
|
||||||
|
['17.0.5', '17.0.5']
|
||||||
|
])('%s -> %s', (input, expected) => {
|
||||||
|
const actual = distributions['convertVersionToSemver'](input);
|
||||||
|
expect(actual).toEqual(expected);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,17 +1,56 @@
|
|||||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
|
||||||
import {
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
|
import type {
|
||||||
ArchitectureOptions,
|
ArchitectureOptions,
|
||||||
LibericaVersion
|
LibericaVersion
|
||||||
} from '../../src/distributions/liberica/models';
|
} from '../../src/distributions/liberica/models.js';
|
||||||
import {HttpClient} from '@actions/http-client';
|
import {HttpClient} from '@actions/http-client';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
import manifestData from '../data/liberica-windows.json';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -21,7 +60,7 @@ describe('getAvailableVersions', () => {
|
|||||||
result: manifestData as LibericaVersion[]
|
result: manifestData as LibericaVersion[]
|
||||||
});
|
});
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -183,7 +222,7 @@ describe('getArchitectureOptions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
describe('findPackageForDownload', () => {
|
||||||
let distribution: LibericaDistributions;
|
let distribution: InstanceType<typeof LibericaDistributions>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
distribution = new LibericaDistributions({
|
distribution = new LibericaDistributions({
|
||||||
|
|||||||
@@ -1,37 +1,101 @@
|
|||||||
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
import * as tc from '@actions/tool-cache';
|
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
import * as util from '../../src/util';
|
|
||||||
|
|
||||||
import {LocalDistribution} from '../../src/distributions/local/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)
|
||||||
|
}));
|
||||||
|
|
||||||
|
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');
|
||||||
|
|
||||||
describe('setupJava', () => {
|
describe('setupJava', () => {
|
||||||
const actualJavaVersion = '11.1.10';
|
const actualJavaVersion = '11.1.10';
|
||||||
const javaPath = path.join('Java_jdkfile_jdk', actualJavaVersion, 'x86');
|
const javaPath = path.join('Java_jdkfile_jdk', actualJavaVersion, 'x86');
|
||||||
|
|
||||||
let mockJavaBase: LocalDistribution;
|
let mockJavaBase: InstanceType<typeof LocalDistribution>;
|
||||||
|
|
||||||
let spyGetToolcachePath: jest.SpyInstance;
|
let spyGetToolcachePath: any;
|
||||||
let spyTcCacheDir: jest.SpyInstance;
|
let spyTcCacheDir: any;
|
||||||
let spyTcFindAllVersions: jest.SpyInstance;
|
let spyTcFindAllVersions: any;
|
||||||
let spyCoreDebug: jest.SpyInstance;
|
let spyCoreDebug: any;
|
||||||
let spyCoreInfo: jest.SpyInstance;
|
let spyCoreInfo: any;
|
||||||
let spyCoreExportVariable: jest.SpyInstance;
|
let spyCoreExportVariable: any;
|
||||||
let spyCoreAddPath: jest.SpyInstance;
|
let spyCoreAddPath: any;
|
||||||
let spyCoreSetOutput: jest.SpyInstance;
|
let spyCoreSetOutput: any;
|
||||||
let spyFsStat: jest.SpyInstance;
|
let spyFsStat: any;
|
||||||
let spyFsReadDir: jest.SpyInstance;
|
let spyFsReadDir: any;
|
||||||
let spyUtilsExtractJdkFile: jest.SpyInstance;
|
let spyUtilsExtractJdkFile: any;
|
||||||
let spyPathResolve: jest.SpyInstance;
|
let spyPathResolve: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
const expectedJdkFile = 'JavaLocalJdkFile';
|
const expectedJdkFile = 'JavaLocalJdkFile';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
spyGetToolcachePath = util.getToolcachePath as jest.Mock;
|
||||||
spyGetToolcachePath.mockImplementation(
|
spyGetToolcachePath.mockImplementation(
|
||||||
(toolname: string, javaVersion: string, architecture: string) => {
|
(toolname: string, javaVersion: string, architecture: string) => {
|
||||||
const semverVersion = new semver.Range(javaVersion);
|
const semverVersion = new semver.Range(javaVersion);
|
||||||
@@ -49,7 +113,7 @@ describe('setupJava', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
spyTcCacheDir = jest.spyOn(tc, 'cacheDir');
|
spyTcCacheDir = tc.cacheDir as jest.Mock;
|
||||||
spyTcCacheDir.mockImplementation(
|
spyTcCacheDir.mockImplementation(
|
||||||
(
|
(
|
||||||
archivePath: string,
|
archivePath: string,
|
||||||
@@ -59,23 +123,23 @@ describe('setupJava', () => {
|
|||||||
) => path.join(toolcacheFolderName, version, architecture)
|
) => path.join(toolcacheFolderName, version, architecture)
|
||||||
);
|
);
|
||||||
|
|
||||||
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
spyTcFindAllVersions = tc.findAllVersions as jest.Mock;
|
||||||
spyTcFindAllVersions.mockReturnValue([actualJavaVersion]);
|
spyTcFindAllVersions.mockReturnValue([actualJavaVersion]);
|
||||||
|
|
||||||
// Spy on core methods
|
// Spy on core methods
|
||||||
spyCoreDebug = jest.spyOn(core, 'debug');
|
spyCoreDebug = core.debug as jest.Mock;
|
||||||
spyCoreDebug.mockImplementation(() => undefined);
|
spyCoreDebug.mockImplementation(() => undefined);
|
||||||
|
|
||||||
spyCoreInfo = jest.spyOn(core, 'info');
|
spyCoreInfo = core.info as jest.Mock;
|
||||||
spyCoreInfo.mockImplementation(() => undefined);
|
spyCoreInfo.mockImplementation(() => undefined);
|
||||||
|
|
||||||
spyCoreAddPath = jest.spyOn(core, 'addPath');
|
spyCoreAddPath = core.addPath as jest.Mock;
|
||||||
spyCoreAddPath.mockImplementation(() => undefined);
|
spyCoreAddPath.mockImplementation(() => undefined);
|
||||||
|
|
||||||
spyCoreExportVariable = jest.spyOn(core, 'exportVariable');
|
spyCoreExportVariable = core.exportVariable as jest.Mock;
|
||||||
spyCoreExportVariable.mockImplementation(() => undefined);
|
spyCoreExportVariable.mockImplementation(() => undefined);
|
||||||
|
|
||||||
spyCoreSetOutput = jest.spyOn(core, 'setOutput');
|
spyCoreSetOutput = core.setOutput as jest.Mock;
|
||||||
spyCoreSetOutput.mockImplementation(() => undefined);
|
spyCoreSetOutput.mockImplementation(() => undefined);
|
||||||
|
|
||||||
// Spy on fs methods
|
// Spy on fs methods
|
||||||
@@ -88,7 +152,7 @@ describe('setupJava', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Spy on util methods
|
// Spy on util methods
|
||||||
spyUtilsExtractJdkFile = jest.spyOn(util, 'extractJdkFile');
|
spyUtilsExtractJdkFile = util.extractJdkFile as jest.Mock;
|
||||||
spyUtilsExtractJdkFile.mockImplementation(() => 'some/random/path/');
|
spyUtilsExtractJdkFile.mockImplementation(() => 'some/random/path/');
|
||||||
|
|
||||||
// Spy on path methods
|
// Spy on path methods
|
||||||
@@ -96,7 +160,7 @@ describe('setupJava', () => {
|
|||||||
spyPathResolve.mockImplementation((path: string) => path);
|
spyPathResolve.mockImplementation((path: string) => path);
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -106,6 +170,20 @@ describe('setupJava', () => {
|
|||||||
jest.restoreAllMocks();
|
jest.restoreAllMocks();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('throws for the latest alias since jdkfile has no version list', async () => {
|
||||||
|
const inputs = {
|
||||||
|
version: 'latest',
|
||||||
|
architecture: 'x86',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
};
|
||||||
|
|
||||||
|
mockJavaBase = new LocalDistribution(inputs, expectedJdkFile);
|
||||||
|
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
||||||
|
"The 'latest' version alias is not supported for the 'jdkfile' distribution. Please specify a concrete version."
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it('java is resolved from toolcache, jdkfile is untouched', async () => {
|
it('java is resolved from toolcache, jdkfile is untouched', async () => {
|
||||||
const inputs = {
|
const inputs = {
|
||||||
version: actualJavaVersion,
|
version: actualJavaVersion,
|
||||||
|
|||||||
@@ -1,23 +1,115 @@
|
|||||||
import {
|
import {
|
||||||
MicrosoftDistributions,
|
jest,
|
||||||
MICROSOFT_PUBLIC_KEY
|
describe,
|
||||||
} from '../../src/distributions/microsoft/installer';
|
it,
|
||||||
import os from 'os';
|
expect,
|
||||||
import data from '../data/microsoft.json';
|
beforeEach,
|
||||||
import * as httpm from '@actions/http-client';
|
afterEach,
|
||||||
import * as core from '@actions/core';
|
beforeAll,
|
||||||
import * as tc from '@actions/tool-cache';
|
afterAll
|
||||||
import * as gpg from '../../src/gpg';
|
} from '@jest/globals';
|
||||||
import * as util from '../../src/util';
|
import {HttpClient} from '@actions/http-client';
|
||||||
import fs from 'fs';
|
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');
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
describe('findPackageForDownload', () => {
|
||||||
let distribution: MicrosoftDistributions;
|
let distribution: InstanceType<typeof MicrosoftDistributions>;
|
||||||
let spyGetManifestFromRepo: jest.SpyInstance;
|
let spyGetManifestFromRepo: any;
|
||||||
let spyDebug: jest.SpyInstance;
|
let spyDebug: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
mockOsArch.mockReturnValue('x64');
|
||||||
|
mockOsPlatform.mockReturnValue(process.platform);
|
||||||
|
|
||||||
distribution = new MicrosoftDistributions({
|
distribution = new MicrosoftDistributions({
|
||||||
version: '',
|
version: '',
|
||||||
architecture: 'x64',
|
architecture: 'x64',
|
||||||
@@ -25,18 +117,18 @@ describe('findPackageForDownload', () => {
|
|||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
|
|
||||||
spyGetManifestFromRepo = jest.spyOn(httpm.HttpClient.prototype, 'getJson');
|
spyGetManifestFromRepo = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
spyGetManifestFromRepo.mockReturnValue({
|
spyGetManifestFromRepo.mockReturnValue({
|
||||||
result: data,
|
result: data,
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {}
|
headers: {}
|
||||||
});
|
});
|
||||||
|
|
||||||
spyDebug = jest.spyOn(core, 'debug');
|
spyDebug = core.debug as jest.Mock;
|
||||||
spyDebug.mockImplementation(() => {});
|
spyDebug.mockImplementation(() => {});
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -118,10 +210,8 @@ 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
|
mockOsArch.mockReturnValue(osArch);
|
||||||
.spyOn(os, 'arch')
|
mockOsPlatform.mockReturnValue('darwin');
|
||||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('darwin');
|
|
||||||
|
|
||||||
const version = '17';
|
const version = '17';
|
||||||
const distro = new MicrosoftDistributions({
|
const distro = new MicrosoftDistributions({
|
||||||
@@ -144,10 +234,8 @@ 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
|
mockOsArch.mockReturnValue(osArch);
|
||||||
.spyOn(os, 'arch')
|
mockOsPlatform.mockReturnValue('linux');
|
||||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
|
||||||
|
|
||||||
const version = '17';
|
const version = '17';
|
||||||
const distro = new MicrosoftDistributions({
|
const distro = new MicrosoftDistributions({
|
||||||
@@ -170,10 +258,8 @@ 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
|
mockOsArch.mockReturnValue(osArch);
|
||||||
.spyOn(os, 'arch')
|
mockOsPlatform.mockReturnValue('win32');
|
||||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('win32');
|
|
||||||
|
|
||||||
const version = '17';
|
const version = '17';
|
||||||
const distro = new MicrosoftDistributions({
|
const distro = new MicrosoftDistributions({
|
||||||
@@ -217,7 +303,7 @@ describe('findPackageForDownload', () => {
|
|||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {}
|
headers: {}
|
||||||
});
|
});
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
mockOsPlatform.mockReturnValue('linux');
|
||||||
|
|
||||||
const result = await distribution['findPackageForDownload']('17.0.10');
|
const result = await distribution['findPackageForDownload']('17.0.10');
|
||||||
|
|
||||||
@@ -228,16 +314,14 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('downloadTool', () => {
|
describe('downloadTool', () => {
|
||||||
let spyDownloadTool: jest.SpyInstance;
|
let spyDownloadTool: any;
|
||||||
let spyExtractJdkFile: jest.SpyInstance;
|
let spyExtractJdkFile: any;
|
||||||
let spyCacheDir: jest.SpyInstance;
|
let spyCacheDir: any;
|
||||||
let spyVerifySignature: jest.SpyInstance;
|
let spyVerifySignature: any;
|
||||||
let distribution: MicrosoftDistributions;
|
let distribution: InstanceType<typeof MicrosoftDistributions>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest
|
mockOsPlatform.mockReturnValue(process.platform);
|
||||||
.spyOn(os, 'platform')
|
|
||||||
.mockReturnValue(process.platform as ReturnType<typeof os.platform>);
|
|
||||||
|
|
||||||
distribution = new MicrosoftDistributions({
|
distribution = new MicrosoftDistributions({
|
||||||
version: '17',
|
version: '17',
|
||||||
@@ -246,27 +330,27 @@ describe('downloadTool', () => {
|
|||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
|
|
||||||
spyDownloadTool = jest.spyOn(tc, 'downloadTool');
|
spyDownloadTool = tc.downloadTool as jest.Mock;
|
||||||
spyDownloadTool.mockImplementation(async () => {
|
spyDownloadTool.mockImplementation(async () => {
|
||||||
return '/tmp/jdk.tar.gz';
|
return '/tmp/jdk.tar.gz';
|
||||||
});
|
});
|
||||||
|
|
||||||
spyExtractJdkFile = jest.spyOn(util, 'extractJdkFile');
|
spyExtractJdkFile = util.extractJdkFile as jest.Mock;
|
||||||
spyExtractJdkFile.mockImplementation(async () => {
|
spyExtractJdkFile.mockImplementation(async () => {
|
||||||
return '/tmp/unpacked';
|
return '/tmp/unpacked';
|
||||||
});
|
});
|
||||||
|
|
||||||
jest.spyOn(fs, 'readdirSync').mockReturnValue(['jdk'] as any);
|
mockReaddirSync.mockReturnValue(['jdk'] as any);
|
||||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
spyCacheDir = tc.cacheDir as jest.Mock;
|
||||||
spyCacheDir.mockImplementation(async () => {
|
spyCacheDir.mockImplementation(async () => {
|
||||||
return '/tmp/cached';
|
return '/tmp/cached';
|
||||||
});
|
});
|
||||||
|
|
||||||
jest
|
(util.renameWinArchive as jest.Mock<any>).mockImplementation(
|
||||||
.spyOn(util, 'renameWinArchive')
|
(archivePath: string) => `${archivePath}.zip`
|
||||||
.mockImplementation((archivePath: string) => `${archivePath}.zip`);
|
);
|
||||||
|
|
||||||
spyVerifySignature = jest.spyOn(gpg, 'verifyPackageSignature');
|
spyVerifySignature = gpg.verifyPackageSignature as jest.Mock;
|
||||||
spyVerifySignature.mockImplementation(async () => {});
|
spyVerifySignature.mockImplementation(async () => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,53 @@
|
|||||||
import {OracleDistribution} from '../../src/distributions/oracle/installer';
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
import {getDownloadArchiveExtension} from '../../src/util';
|
|
||||||
import {HttpClient} from '@actions/http-client';
|
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', () => {
|
describe('findPackageForDownload', () => {
|
||||||
let distribution: OracleDistribution;
|
let distribution: InstanceType<typeof OracleDistribution>;
|
||||||
let spyDebug: jest.SpyInstance;
|
let spyDebug: any;
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
distribution = new OracleDistribution({
|
distribution = new OracleDistribution({
|
||||||
@@ -18,11 +57,11 @@ describe('findPackageForDownload', () => {
|
|||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
|
|
||||||
spyDebug = jest.spyOn(core, 'debug');
|
spyDebug = core.debug as jest.Mock;
|
||||||
spyDebug.mockImplementation(() => {});
|
spyDebug.mockImplementation(() => {});
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -135,3 +174,59 @@ describe('findPackageForDownload', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
describe('findPackageForDownload with latest', () => {
|
||||||
|
let spyHttpClientHead: any;
|
||||||
|
let spyHttpClientGetJson: any;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
(core.debug as jest.Mock).mockImplementation(() => {});
|
||||||
|
(core.error as jest.Mock).mockImplementation(() => {});
|
||||||
|
spyHttpClientGetJson = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
|
spyHttpClientGetJson.mockResolvedValue({
|
||||||
|
statusCode: 200,
|
||||||
|
result: {most_recent_feature_release: 25},
|
||||||
|
headers: {}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.restoreAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('resolves the newest major version from the Adoptium API', async () => {
|
||||||
|
spyHttpClientHead = jest.spyOn(HttpClient.prototype, 'head');
|
||||||
|
spyHttpClientHead.mockResolvedValue({message: {statusCode: 200}});
|
||||||
|
|
||||||
|
const distribution = new OracleDistribution({
|
||||||
|
version: 'latest',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await distribution['findPackageForDownload']('x');
|
||||||
|
const osType = distribution.getPlatform();
|
||||||
|
const archiveType = getDownloadArchiveExtension();
|
||||||
|
|
||||||
|
expect(result.version).toBe('25');
|
||||||
|
expect(result.url).toBe(
|
||||||
|
`https://download.oracle.com/java/25/latest/jdk-25_${osType}-x64_bin.${archiveType}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('throws an actionable error when the latest major is not yet available', async () => {
|
||||||
|
spyHttpClientHead = jest.spyOn(HttpClient.prototype, 'head');
|
||||||
|
spyHttpClientHead.mockResolvedValue({message: {statusCode: 404}});
|
||||||
|
|
||||||
|
const distribution = new OracleDistribution({
|
||||||
|
version: 'latest',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
|
||||||
|
await expect(distribution['findPackageForDownload']('x')).rejects.toThrow(
|
||||||
|
/is not yet available for the Oracle JDK distribution/
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
@@ -1,14 +1,59 @@
|
|||||||
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
import {HttpClient} from '@actions/http-client';
|
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';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
let spyUtilGetDownloadArchiveExtension: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -18,14 +63,12 @@ describe('getAvailableVersions', () => {
|
|||||||
result: manifestData
|
result: manifestData
|
||||||
});
|
});
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
spyUtilGetDownloadArchiveExtension =
|
||||||
utils,
|
utils.getDownloadArchiveExtension as jest.Mock<any>;
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -36,7 +79,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const mockPlatform = (
|
const mockPlatform = (
|
||||||
distribution: SapMachineDistribution,
|
distribution: InstanceType<typeof SapMachineDistribution>,
|
||||||
platform: string
|
platform: string
|
||||||
) => {
|
) => {
|
||||||
distribution['getPlatformOption'] = () => platform;
|
distribution['getPlatformOption'] = () => platform;
|
||||||
|
|||||||
@@ -1,15 +1,53 @@
|
|||||||
|
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 {HttpClient} from '@actions/http-client';
|
||||||
|
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
import manifestData from '../data/semeru.json' with {type: 'json'};
|
||||||
import {SemeruDistribution} from '../../src/distributions/semeru/installer';
|
|
||||||
|
|
||||||
import manifestData from '../data/semeru.json';
|
// Mock @actions/core before importing source modules that depend on it
|
||||||
import * as core from '@actions/core';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
let spyCoreWarning: jest.SpyInstance;
|
let spyCoreWarning: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -19,9 +57,9 @@ describe('getAvailableVersions', () => {
|
|||||||
result: []
|
result: []
|
||||||
});
|
});
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
spyCoreWarning = jest.spyOn(core, 'warning');
|
spyCoreWarning = core.warning as jest.Mock;
|
||||||
spyCoreWarning.mockImplementation(() => {});
|
spyCoreWarning.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,23 +1,92 @@
|
|||||||
|
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 {HttpClient} from '@actions/http-client';
|
||||||
import * as tc from '@actions/tool-cache';
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'os';
|
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';
|
import manifestData from '../data/temurin.json' with {type: 'json'};
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
// 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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
let spyCoreWarning: jest.SpyInstance;
|
let spyCoreWarning: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
@@ -27,9 +96,9 @@ describe('getAvailableVersions', () => {
|
|||||||
result: []
|
result: []
|
||||||
});
|
});
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
spyCoreWarning = jest.spyOn(core, 'warning');
|
spyCoreWarning = core.warning as jest.Mock;
|
||||||
spyCoreWarning.mockImplementation(() => {});
|
spyCoreWarning.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -84,7 +153,7 @@ describe('getAvailableVersions', () => {
|
|||||||
'build correct url for %s',
|
'build correct url for %s',
|
||||||
async (
|
async (
|
||||||
installerOptions: JavaInstallerOptions,
|
installerOptions: JavaInstallerOptions,
|
||||||
impl: TemurinImplementation,
|
impl: TemurinImplementationType,
|
||||||
expectedParameters
|
expectedParameters
|
||||||
) => {
|
) => {
|
||||||
const distribution = new TemurinDistribution(installerOptions, impl);
|
const distribution = new TemurinDistribution(installerOptions, impl);
|
||||||
@@ -163,7 +232,11 @@ describe('getAvailableVersions', () => {
|
|||||||
[TemurinImplementation.Hotspot, 'jre', 'Java_Temurin-Hotspot_jre']
|
[TemurinImplementation.Hotspot, 'jre', 'Java_Temurin-Hotspot_jre']
|
||||||
])(
|
])(
|
||||||
'find right toolchain folder',
|
'find right toolchain folder',
|
||||||
(impl: TemurinImplementation, packageType: string, expected: string) => {
|
(
|
||||||
|
impl: TemurinImplementationType,
|
||||||
|
packageType: string,
|
||||||
|
expected: string
|
||||||
|
) => {
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{
|
||||||
version: '8',
|
version: '8',
|
||||||
@@ -239,6 +312,24 @@ describe('findPackageForDownload', () => {
|
|||||||
expect(resolvedVersion.signatureUrl).toBeDefined();
|
expect(resolvedVersion.signatureUrl).toBeDefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('version "latest" is normalized to the newest available version', async () => {
|
||||||
|
const distribution = new TemurinDistribution(
|
||||||
|
{
|
||||||
|
version: 'latest',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
},
|
||||||
|
TemurinImplementation.Hotspot
|
||||||
|
);
|
||||||
|
distribution['getAvailableVersions'] = async () => manifestData as any;
|
||||||
|
// normalizeVersion turns `latest` into the wildcard carried on `this.version`
|
||||||
|
const resolvedVersion = await distribution['findPackageForDownload'](
|
||||||
|
distribution['version']
|
||||||
|
);
|
||||||
|
expect(resolvedVersion.version).toBe('16.0.2+7');
|
||||||
|
});
|
||||||
|
|
||||||
it('version is found but binaries list is empty', async () => {
|
it('version is found but binaries list is empty', async () => {
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{
|
||||||
@@ -289,25 +380,25 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('downloadTool', () => {
|
describe('downloadTool', () => {
|
||||||
let spyDownloadTool: jest.SpyInstance;
|
let spyDownloadTool: any;
|
||||||
let spyVerifySignature: jest.SpyInstance;
|
let spyVerifySignature: any;
|
||||||
let spyExtractJdkFile: jest.SpyInstance;
|
let spyExtractJdkFile: any;
|
||||||
let spyCacheDir: jest.SpyInstance;
|
let spyCacheDir: any;
|
||||||
let spyReadDirSync: jest.SpyInstance;
|
let spyReadDirSync: any;
|
||||||
let spyRenameWinArchive: jest.SpyInstance;
|
let spyRenameWinArchive: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyDownloadTool = jest.spyOn(tc, 'downloadTool');
|
spyDownloadTool = tc.downloadTool as jest.Mock;
|
||||||
spyDownloadTool.mockResolvedValue('/tmp/jdk.tar.gz');
|
spyDownloadTool.mockResolvedValue('/tmp/jdk.tar.gz');
|
||||||
spyVerifySignature = jest.spyOn(gpg, 'verifyPackageSignature');
|
spyVerifySignature = gpg.verifyPackageSignature as jest.Mock;
|
||||||
spyVerifySignature.mockResolvedValue(undefined);
|
spyVerifySignature.mockResolvedValue(undefined);
|
||||||
spyExtractJdkFile = jest.spyOn(util, 'extractJdkFile');
|
spyExtractJdkFile = util.extractJdkFile as jest.Mock;
|
||||||
spyExtractJdkFile.mockResolvedValue('/tmp/extracted');
|
spyExtractJdkFile.mockResolvedValue('/tmp/extracted');
|
||||||
spyCacheDir = jest.spyOn(tc, 'cacheDir');
|
spyCacheDir = tc.cacheDir as jest.Mock;
|
||||||
spyCacheDir.mockResolvedValue('/tmp/toolcache');
|
spyCacheDir.mockResolvedValue('/tmp/toolcache');
|
||||||
spyReadDirSync = jest.spyOn(fs, 'readdirSync');
|
spyReadDirSync = jest.spyOn(fs, 'readdirSync');
|
||||||
spyReadDirSync.mockReturnValue(['jdk-17'] as any);
|
spyReadDirSync.mockReturnValue(['jdk-17'] as any);
|
||||||
spyRenameWinArchive = jest.spyOn(util, 'renameWinArchive');
|
spyRenameWinArchive = util.renameWinArchive as jest.Mock;
|
||||||
spyRenameWinArchive.mockReturnValue('/tmp/jdk.tar.gz.zip');
|
spyRenameWinArchive.mockReturnValue('/tmp/jdk.tar.gz.zip');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,75 @@
|
|||||||
|
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 {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 os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
import manifestData from '../data/zulu-releases-default.json';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
spyHttpClient.mockReturnValue({
|
spyHttpClient.mockReturnValue({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as IZuluVersions[]
|
result: [] as IZuluVersions[]
|
||||||
});
|
});
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
(utils.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||||
utils,
|
'tar.gz'
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
);
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,7 +87,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -54,7 +96,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -63,7 +105,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -72,7 +114,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jre',
|
packageType: 'jre',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -81,7 +123,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk+fx',
|
packageType: 'jdk+fx',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -90,7 +132,16 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jre+fx',
|
packageType: 'jre+fx',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -99,7 +150,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -108,12 +159,12 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
|
'?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'
|
||||||
]
|
]
|
||||||
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
||||||
const distribution = new ZuluDistribution(input);
|
const distribution = new ZuluDistribution(input);
|
||||||
distribution['getPlatformOption'] = () => 'macos';
|
distribution['getPlatformOption'] = () => 'macos';
|
||||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
|
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
await distribution['getAvailableVersions']();
|
||||||
|
|
||||||
@@ -121,16 +172,12 @@ describe('getAvailableVersions', () => {
|
|||||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
type DistroArch = {
|
|
||||||
bitness: string;
|
|
||||||
arch: string;
|
|
||||||
};
|
|
||||||
it.each([
|
it.each([
|
||||||
['amd64', {bitness: '64', arch: 'x86'}],
|
['amd64', 'x64'],
|
||||||
['arm64', {bitness: '64', arch: 'arm'}]
|
['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: DistroArch) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest
|
jest
|
||||||
.spyOn(os, 'arch')
|
.spyOn(os, 'arch')
|
||||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
@@ -142,7 +189,7 @@ describe('getAvailableVersions', () => {
|
|||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
distribution['getPlatformOption'] = () => 'macos';
|
distribution['getPlatformOption'] = () => 'macos';
|
||||||
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`;
|
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`;
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
await distribution['getAvailableVersions']();
|
||||||
|
|
||||||
@@ -152,6 +199,18 @@ describe('getAvailableVersions', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
it('load available versions', async () => {
|
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({
|
const distribution = new ZuluDistribution({
|
||||||
version: '11',
|
version: '11',
|
||||||
architecture: 'x86',
|
architecture: 'x86',
|
||||||
@@ -165,10 +224,11 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
[{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
|
[{architecture: 'x64'}, 'x64'],
|
||||||
[{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
|
[{architecture: 'x86'}, 'i686'],
|
||||||
[{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
|
[{architecture: 'aarch64'}, 'aarch64'],
|
||||||
[{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
|
[{architecture: 'arm64'}, 'aarch64'],
|
||||||
|
[{architecture: 'arm'}, 'arm']
|
||||||
])('%s -> %s', (input, expected) => {
|
])('%s -> %s', (input, expected) => {
|
||||||
const distribution = new ZuluDistribution({
|
const distribution = new ZuluDistribution({
|
||||||
version: '11',
|
version: '11',
|
||||||
@@ -176,7 +236,7 @@ describe('getArchitectureOptions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
expect(distribution['getArchitectureOptions']()).toEqual(expected);
|
expect(distribution['getArchitectureOptions']()).toBe(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,77 @@
|
|||||||
|
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 {HttpClient} from '@actions/http-client';
|
||||||
import * as semver from 'semver';
|
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 os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
import manifestData from '../data/zulu-linux.json';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
let spyUtilGetDownloadArchiveExtension: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
spyHttpClient.mockReturnValue({
|
spyHttpClient.mockReturnValue({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as IZuluVersions[]
|
result: [] as IZuluVersions[]
|
||||||
});
|
});
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
spyUtilGetDownloadArchiveExtension =
|
||||||
utils,
|
utils.getDownloadArchiveExtension as jest.Mock<any>;
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
|
spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -46,7 +89,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -55,7 +98,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -64,7 +107,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -73,7 +116,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jre',
|
packageType: 'jre',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux&ext=zip&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -82,7 +125,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk+fx',
|
packageType: 'jdk+fx',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -91,7 +134,16 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jre+fx',
|
packageType: 'jre+fx',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux&ext=zip&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -100,7 +152,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -109,12 +161,12 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=linux&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
|
'?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'
|
||||||
]
|
]
|
||||||
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
||||||
const distribution = new ZuluDistribution(input);
|
const distribution = new ZuluDistribution(input);
|
||||||
distribution['getPlatformOption'] = () => 'linux';
|
distribution['getPlatformOption'] = () => 'linux_glibc';
|
||||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
|
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
await distribution['getAvailableVersions']();
|
||||||
|
|
||||||
@@ -122,16 +174,12 @@ describe('getAvailableVersions', () => {
|
|||||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
type DistroArch = {
|
|
||||||
bitness: string;
|
|
||||||
arch: string;
|
|
||||||
};
|
|
||||||
it.each([
|
it.each([
|
||||||
['amd64', {bitness: '64', arch: 'x86'}],
|
['amd64', 'x64'],
|
||||||
['arm64', {bitness: '64', arch: 'arm'}]
|
['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: DistroArch) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest
|
jest
|
||||||
.spyOn(os, 'arch')
|
.spyOn(os, 'arch')
|
||||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
@@ -142,10 +190,10 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
distribution['getPlatformOption'] = () => 'linux';
|
distribution['getPlatformOption'] = () => 'linux_glibc';
|
||||||
// Override extension for linux default arch case to match util behavior
|
// Override extension for linux default arch case to match util behavior
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
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`;
|
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`;
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
await distribution['getAvailableVersions']();
|
||||||
|
|
||||||
@@ -155,6 +203,18 @@ describe('getAvailableVersions', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
it('load available versions', async () => {
|
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({
|
const distribution = new ZuluDistribution({
|
||||||
version: '11',
|
version: '11',
|
||||||
architecture: 'x86',
|
architecture: 'x86',
|
||||||
@@ -168,10 +228,11 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
[{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
|
[{architecture: 'x64'}, 'x64'],
|
||||||
[{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
|
[{architecture: 'x86'}, 'i686'],
|
||||||
[{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
|
[{architecture: 'aarch64'}, 'aarch64'],
|
||||||
[{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
|
[{architecture: 'arm64'}, 'aarch64'],
|
||||||
|
[{architecture: 'arm'}, 'arm']
|
||||||
])('%s -> %s', (input, expected) => {
|
])('%s -> %s', (input, expected) => {
|
||||||
const distribution = new ZuluDistribution({
|
const distribution = new ZuluDistribution({
|
||||||
version: '11',
|
version: '11',
|
||||||
@@ -179,7 +240,7 @@ describe('getArchitectureOptions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
expect(distribution['getArchitectureOptions']()).toEqual(expected);
|
expect(distribution['getArchitectureOptions']()).toBe(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -1,34 +1,76 @@
|
|||||||
|
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 {HttpClient} from '@actions/http-client';
|
||||||
import * as semver from 'semver';
|
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 os from 'os';
|
||||||
import * as core from '@actions/core';
|
|
||||||
|
|
||||||
import manifestData from '../data/zulu-windows.json';
|
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');
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: any;
|
||||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
let spyCoreError: any;
|
||||||
let spyCoreError: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
spyHttpClient.mockReturnValue({
|
spyHttpClient.mockReturnValue({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as IZuluVersions[]
|
result: [] as IZuluVersions[]
|
||||||
});
|
});
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
(utils.getDownloadArchiveExtension as jest.Mock<any>).mockReturnValue(
|
||||||
utils,
|
'zip'
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
);
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('zip');
|
|
||||||
|
|
||||||
// Mock core.error to suppress error logs
|
// Mock core.error to suppress error logs
|
||||||
spyCoreError = jest.spyOn(core, 'error');
|
spyCoreError = core.error as jest.Mock;
|
||||||
spyCoreError.mockImplementation(() => {});
|
spyCoreError.mockImplementation(() => {});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -46,7 +88,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -55,7 +97,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -64,7 +106,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -73,7 +115,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jre',
|
packageType: 'jre',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=windows&ext=zip&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -82,7 +124,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk+fx',
|
packageType: 'jdk+fx',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -91,7 +133,16 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jre+fx',
|
packageType: 'jre+fx',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=windows&ext=zip&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -100,7 +151,7 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
|
'?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'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
@@ -109,12 +160,12 @@ describe('getAvailableVersions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
},
|
},
|
||||||
'?os=windows&ext=zip&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
|
'?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'
|
||||||
]
|
]
|
||||||
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
||||||
const distribution = new ZuluDistribution(input);
|
const distribution = new ZuluDistribution(input);
|
||||||
distribution['getPlatformOption'] = () => 'windows';
|
distribution['getPlatformOption'] = () => 'windows';
|
||||||
const buildUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/${parsedUrl}`;
|
const buildUrl = `https://api.azul.com/metadata/v1/zulu/packages/${parsedUrl}`;
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
await distribution['getAvailableVersions']();
|
||||||
|
|
||||||
@@ -122,16 +173,12 @@ describe('getAvailableVersions', () => {
|
|||||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||||
});
|
});
|
||||||
|
|
||||||
type DistroArch = {
|
|
||||||
bitness: string;
|
|
||||||
arch: string;
|
|
||||||
};
|
|
||||||
it.each([
|
it.each([
|
||||||
['amd64', {bitness: '64', arch: 'x86'}],
|
['amd64', 'x64'],
|
||||||
['arm64', {bitness: '64', arch: 'arm'}]
|
['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: DistroArch) => {
|
async (osArch: string, distroArch: string) => {
|
||||||
jest
|
jest
|
||||||
.spyOn(os, 'arch')
|
.spyOn(os, 'arch')
|
||||||
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
.mockReturnValue(osArch as ReturnType<typeof os.arch>);
|
||||||
@@ -143,7 +190,7 @@ describe('getAvailableVersions', () => {
|
|||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
distribution['getPlatformOption'] = () => 'windows';
|
distribution['getPlatformOption'] = () => 'windows';
|
||||||
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`;
|
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`;
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
await distribution['getAvailableVersions']();
|
||||||
|
|
||||||
@@ -153,6 +200,18 @@ describe('getAvailableVersions', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
it('load available versions', async () => {
|
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({
|
const distribution = new ZuluDistribution({
|
||||||
version: '11',
|
version: '11',
|
||||||
architecture: 'x86',
|
architecture: 'x86',
|
||||||
@@ -166,10 +225,11 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
[{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
|
[{architecture: 'x64'}, 'x64'],
|
||||||
[{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
|
[{architecture: 'x86'}, 'i686'],
|
||||||
[{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
|
[{architecture: 'aarch64'}, 'aarch64'],
|
||||||
[{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
|
[{architecture: 'arm64'}, 'aarch64'],
|
||||||
|
[{architecture: 'arm'}, 'arm']
|
||||||
])('%s -> %s', (input, expected) => {
|
])('%s -> %s', (input, expected) => {
|
||||||
const distribution = new ZuluDistribution({
|
const distribution = new ZuluDistribution({
|
||||||
version: '11',
|
version: '11',
|
||||||
@@ -177,7 +237,7 @@ describe('getArchitectureOptions', () => {
|
|||||||
packageType: 'jdk',
|
packageType: 'jdk',
|
||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
expect(distribution['getArchitectureOptions']()).toEqual(expected);
|
expect(distribution['getArchitectureOptions']()).toBe(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+23
-12
@@ -1,20 +1,29 @@
|
|||||||
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterAll,
|
||||||
|
afterEach
|
||||||
|
} from '@jest/globals';
|
||||||
|
import {fileURLToPath} from 'url';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as io from '@actions/io';
|
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';
|
|
||||||
|
|
||||||
jest.mock('@actions/exec', () => {
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
return {
|
|
||||||
|
jest.unstable_mockModule('@actions/exec', () => ({
|
||||||
exec: jest.fn()
|
exec: jest.fn()
|
||||||
};
|
}));
|
||||||
});
|
|
||||||
|
|
||||||
jest.mock('@actions/tool-cache', () => {
|
jest.unstable_mockModule('@actions/tool-cache', () => ({
|
||||||
return {
|
|
||||||
downloadTool: jest.fn()
|
downloadTool: jest.fn()
|
||||||
};
|
}));
|
||||||
});
|
|
||||||
|
const exec = await import('@actions/exec');
|
||||||
|
const tc = await import('@actions/tool-cache');
|
||||||
|
const gpg = await import('../src/gpg.js');
|
||||||
|
|
||||||
const tempDir = path.join(__dirname, 'runner', 'temp');
|
const tempDir = path.join(__dirname, 'runner', 'temp');
|
||||||
process.env['RUNNER_TEMP'] = tempDir;
|
process.env['RUNNER_TEMP'] = tempDir;
|
||||||
@@ -92,7 +101,9 @@ describe('gpg tests', () => {
|
|||||||
it('imports bundled key and verifies package', async () => {
|
it('imports bundled key and verifies package', async () => {
|
||||||
const publicKeyContent =
|
const publicKeyContent =
|
||||||
'-----BEGIN PGP PUBLIC KEY BLOCK-----\ntest\n-----END PGP PUBLIC KEY BLOCK-----';
|
'-----BEGIN PGP PUBLIC KEY BLOCK-----\ntest\n-----END PGP PUBLIC KEY BLOCK-----';
|
||||||
(tc.downloadTool as jest.Mock).mockResolvedValue('/tmp/jdk.tar.gz.sig');
|
(tc.downloadTool as jest.Mock<any>).mockResolvedValue(
|
||||||
|
'/tmp/jdk.tar.gz.sig'
|
||||||
|
);
|
||||||
await gpg.verifyPackageSignature(
|
await gpg.verifyPackageSignature(
|
||||||
'/tmp/jdk.tar.gz',
|
'/tmp/jdk.tar.gz',
|
||||||
'https://example.com/jdk.tar.gz.sig',
|
'https://example.com/jdk.tar.gz.sig',
|
||||||
|
|||||||
@@ -1,42 +1,68 @@
|
|||||||
import * as core from '@actions/core';
|
import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
|
||||||
|
|
||||||
import {configureMavenArgs} from '../src/maven-args';
|
const mockGetInput = jest.fn<(...args: any[]) => any>();
|
||||||
import {
|
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 {
|
||||||
INPUT_SHOW_DOWNLOAD_PROGRESS,
|
INPUT_SHOW_DOWNLOAD_PROGRESS,
|
||||||
MAVEN_ARGS_ENV,
|
MAVEN_ARGS_ENV,
|
||||||
MAVEN_NO_TRANSFER_PROGRESS_FLAG
|
MAVEN_NO_TRANSFER_PROGRESS_FLAG
|
||||||
} from '../src/constants';
|
} = await import('../src/constants.js');
|
||||||
|
|
||||||
describe('configureMavenArgs', () => {
|
describe('configureMavenArgs', () => {
|
||||||
let inputs: Record<string, string>;
|
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];
|
const originalMavenArgs = process.env[MAVEN_ARGS_ENV];
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
inputs = {};
|
inputs = {};
|
||||||
|
|
||||||
spyGetInput = jest.spyOn(core, 'getInput');
|
mockGetInput.mockImplementation((name: string) => inputs[name] ?? '');
|
||||||
spyGetInput.mockImplementation((name: string) => inputs[name] ?? '');
|
mockExportVariable.mockImplementation((name: string, value: string) => {
|
||||||
|
|
||||||
spyExportVariable = jest.spyOn(core, 'exportVariable');
|
|
||||||
spyExportVariable.mockImplementation((name: string, value: string) => {
|
|
||||||
process.env[name] = value;
|
process.env[name] = value;
|
||||||
});
|
});
|
||||||
|
mockInfo.mockImplementation(() => undefined);
|
||||||
spyInfo = jest.spyOn(core, 'info');
|
mockDebug.mockImplementation(() => undefined);
|
||||||
spyInfo.mockImplementation(() => undefined);
|
|
||||||
|
|
||||||
spyDebug = jest.spyOn(core, 'debug');
|
|
||||||
spyDebug.mockImplementation(() => undefined);
|
|
||||||
|
|
||||||
delete process.env[MAVEN_ARGS_ENV];
|
delete process.env[MAVEN_ARGS_ENV];
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
jest.restoreAllMocks();
|
jest.resetAllMocks();
|
||||||
if (originalMavenArgs === undefined) {
|
if (originalMavenArgs === undefined) {
|
||||||
delete process.env[MAVEN_ARGS_ENV];
|
delete process.env[MAVEN_ARGS_ENV];
|
||||||
} else {
|
} else {
|
||||||
@@ -47,7 +73,7 @@ describe('configureMavenArgs', () => {
|
|||||||
it('sets MAVEN_ARGS with -ntp by default', () => {
|
it('sets MAVEN_ARGS with -ntp by default', () => {
|
||||||
configureMavenArgs();
|
configureMavenArgs();
|
||||||
|
|
||||||
expect(spyExportVariable).toHaveBeenCalledWith(
|
expect(mockExportVariable).toHaveBeenCalledWith(
|
||||||
MAVEN_ARGS_ENV,
|
MAVEN_ARGS_ENV,
|
||||||
MAVEN_NO_TRANSFER_PROGRESS_FLAG
|
MAVEN_NO_TRANSFER_PROGRESS_FLAG
|
||||||
);
|
);
|
||||||
@@ -59,7 +85,7 @@ describe('configureMavenArgs', () => {
|
|||||||
|
|
||||||
configureMavenArgs();
|
configureMavenArgs();
|
||||||
|
|
||||||
expect(spyExportVariable).not.toHaveBeenCalled();
|
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||||
expect(process.env[MAVEN_ARGS_ENV]).toBeUndefined();
|
expect(process.env[MAVEN_ARGS_ENV]).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -68,7 +94,7 @@ describe('configureMavenArgs', () => {
|
|||||||
|
|
||||||
configureMavenArgs();
|
configureMavenArgs();
|
||||||
|
|
||||||
expect(spyExportVariable).toHaveBeenCalledWith(
|
expect(mockExportVariable).toHaveBeenCalledWith(
|
||||||
MAVEN_ARGS_ENV,
|
MAVEN_ARGS_ENV,
|
||||||
`-B -Dstyle.color=always ${MAVEN_NO_TRANSFER_PROGRESS_FLAG}`
|
`-B -Dstyle.color=always ${MAVEN_NO_TRANSFER_PROGRESS_FLAG}`
|
||||||
);
|
);
|
||||||
@@ -79,7 +105,7 @@ describe('configureMavenArgs', () => {
|
|||||||
|
|
||||||
configureMavenArgs();
|
configureMavenArgs();
|
||||||
|
|
||||||
expect(spyExportVariable).not.toHaveBeenCalled();
|
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||||
expect(process.env[MAVEN_ARGS_ENV]).toBe('-B -ntp');
|
expect(process.env[MAVEN_ARGS_ENV]).toBe('-B -ntp');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -88,7 +114,7 @@ describe('configureMavenArgs', () => {
|
|||||||
|
|
||||||
configureMavenArgs();
|
configureMavenArgs();
|
||||||
|
|
||||||
expect(spyExportVariable).not.toHaveBeenCalled();
|
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||||
expect(process.env[MAVEN_ARGS_ENV]).toBe('--no-transfer-progress -B');
|
expect(process.env[MAVEN_ARGS_ENV]).toBe('--no-transfer-progress -B');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -98,7 +124,7 @@ describe('configureMavenArgs', () => {
|
|||||||
|
|
||||||
configureMavenArgs();
|
configureMavenArgs();
|
||||||
|
|
||||||
expect(spyExportVariable).not.toHaveBeenCalled();
|
expect(mockExportVariable).not.toHaveBeenCalled();
|
||||||
expect(process.env[MAVEN_ARGS_ENV]).toBe('-B');
|
expect(process.env[MAVEN_ARGS_ENV]).toBe('-B');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import {afterEach, beforeEach, describe, expect, it, jest} from '@jest/globals';
|
||||||
|
|
||||||
|
const mockGetInput = jest.fn<(...args: any[]) => any>();
|
||||||
|
const mockInfo = jest.fn<(...args: any[]) => any>();
|
||||||
|
const mockDebug = jest.fn<(...args: any[]) => any>();
|
||||||
|
|
||||||
|
jest.unstable_mockModule('@actions/core', () => ({
|
||||||
|
getInput: mockGetInput,
|
||||||
|
info: mockInfo,
|
||||||
|
debug: mockDebug,
|
||||||
|
warning: jest.fn(),
|
||||||
|
setSecret: jest.fn()
|
||||||
|
}));
|
||||||
|
|
||||||
|
const {configureProblemMatcher} = await import('../src/problem-matcher.js');
|
||||||
|
const {INPUT_PROBLEM_MATCHER} = await import('../src/constants.js');
|
||||||
|
|
||||||
|
describe('configureProblemMatcher', () => {
|
||||||
|
let inputs: Record<string, string>;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
inputs = {};
|
||||||
|
mockGetInput.mockImplementation((name: string) => inputs[name] ?? '');
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.resetAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('registers the Java problem matcher by default', () => {
|
||||||
|
configureProblemMatcher('/matchers/java.json');
|
||||||
|
|
||||||
|
expect(mockInfo).toHaveBeenCalledWith('##[add-matcher]/matchers/java.json');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not register the Java problem matcher when disabled', () => {
|
||||||
|
inputs[INPUT_PROBLEM_MATCHER] = 'false';
|
||||||
|
|
||||||
|
configureProblemMatcher('/matchers/java.json');
|
||||||
|
|
||||||
|
expect(mockInfo).not.toHaveBeenCalled();
|
||||||
|
expect(mockDebug).toHaveBeenCalledWith('Java problem matcher is disabled');
|
||||||
|
});
|
||||||
|
});
|
||||||
+124
-32
@@ -1,23 +1,63 @@
|
|||||||
|
import {
|
||||||
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterEach,
|
||||||
|
beforeAll,
|
||||||
|
afterAll
|
||||||
|
} from '@jest/globals';
|
||||||
|
import {fileURLToPath} from 'url';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as core from '@actions/core';
|
|
||||||
import * as io from '@actions/io';
|
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 m2Dir = path.join(__dirname, M2_DIR);
|
||||||
const toolchainsFile = path.join(m2Dir, MVN_TOOLCHAINS_FILE);
|
const toolchainsFile = path.join(m2Dir, MVN_TOOLCHAINS_FILE);
|
||||||
|
|
||||||
describe('toolchains tests', () => {
|
describe('toolchains tests', () => {
|
||||||
let spyOSHomedir: jest.SpyInstance;
|
let spyOSHomedir: any;
|
||||||
let spyInfo: jest.SpyInstance;
|
let spyInfo: any;
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await io.rmRF(m2Dir);
|
await io.rmRF(m2Dir);
|
||||||
spyOSHomedir = jest.spyOn(os, 'homedir');
|
spyOSHomedir = jest.spyOn(os, 'homedir');
|
||||||
spyOSHomedir.mockReturnValue(__dirname);
|
spyOSHomedir.mockReturnValue(__dirname);
|
||||||
spyInfo = jest.spyOn(core, 'info');
|
spyInfo = core.info as jest.Mock;
|
||||||
spyInfo.mockImplementation(() => null);
|
spyInfo.mockImplementation(() => null);
|
||||||
}, 300000);
|
}, 300000);
|
||||||
|
|
||||||
@@ -46,8 +86,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: altHome,
|
settingsDirectory: altHome
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(false);
|
expect(fs.existsSync(m2Dir)).toBe(false);
|
||||||
@@ -95,8 +134,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -177,8 +215,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -263,8 +300,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -341,8 +377,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -412,8 +447,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -505,8 +539,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -565,8 +598,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -624,8 +656,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -708,8 +739,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -788,8 +818,7 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
@@ -814,7 +843,7 @@ describe('toolchains tests', () => {
|
|||||||
).toEqual(result);
|
).toEqual(result);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
it('does not overwrite existing toolchains.xml files', async () => {
|
it('extends existing toolchains.xml files instead of overwriting them', async () => {
|
||||||
const jdkInfo = {
|
const jdkInfo = {
|
||||||
version: '17',
|
version: '17',
|
||||||
vendor: 'Eclipse Temurin',
|
vendor: 'Eclipse Temurin',
|
||||||
@@ -843,13 +872,20 @@ describe('toolchains tests', () => {
|
|||||||
|
|
||||||
await toolchains.createToolchainsSettings({
|
await toolchains.createToolchainsSettings({
|
||||||
jdkInfo,
|
jdkInfo,
|
||||||
settingsDirectory: m2Dir,
|
settingsDirectory: m2Dir
|
||||||
overwriteSettings: false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(originalFile);
|
|
||||||
|
const updated = fs.readFileSync(toolchainsFile, 'utf-8');
|
||||||
|
// The pre-existing (Sun 1.6) toolchain must be preserved ...
|
||||||
|
expect(updated).toContain('<id>sun_1.6</id>');
|
||||||
|
expect(updated).toContain('<jdkHome>/opt/jdk/sun/1.6</jdkHome>');
|
||||||
|
// ... and the newly installed JDK must be appended.
|
||||||
|
expect(updated).toContain('<id>temurin_17</id>');
|
||||||
|
expect(updated).toContain('<vendor>Eclipse Temurin</vendor>');
|
||||||
|
expect(updated).toContain(`<jdkHome>${jdkInfo.jdkHome}</jdkHome>`);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
it('generates valid toolchains.xml with minimal configuration', () => {
|
it('generates valid toolchains.xml with minimal configuration', () => {
|
||||||
@@ -895,6 +931,11 @@ describe('toolchains tests', () => {
|
|||||||
const jdkHome =
|
const jdkHome =
|
||||||
'/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64';
|
'/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(
|
await toolchains.configureToolchains(
|
||||||
version,
|
version,
|
||||||
distributionName,
|
distributionName,
|
||||||
@@ -914,4 +955,55 @@ describe('toolchains tests', () => {
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
|
it('preserves toolchains from previous executions across multiple setup-java runs', async () => {
|
||||||
|
// Regression test for https://github.com/actions/setup-java/issues/1099
|
||||||
|
// Running setup-java several times in the same job (e.g. multiple steps / multiple
|
||||||
|
// java-version entries) must accumulate every JDK in toolchains.xml rather
|
||||||
|
// than replacing previously registered entries.
|
||||||
|
(core.getInput as jest.Mock<any>).mockImplementation((name: string) => {
|
||||||
|
if (name === 'settings-path') return m2Dir;
|
||||||
|
return '';
|
||||||
|
});
|
||||||
|
|
||||||
|
const runs = [
|
||||||
|
{
|
||||||
|
version: '8',
|
||||||
|
distributionName: 'temurin',
|
||||||
|
id: 'temurin_8',
|
||||||
|
jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.1-12/x64'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
version: '11',
|
||||||
|
distributionName: 'temurin',
|
||||||
|
id: 'temurin_11',
|
||||||
|
jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.1-12/x64'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
version: '17',
|
||||||
|
distributionName: 'temurin',
|
||||||
|
id: 'temurin_17',
|
||||||
|
jdkHome: '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64'
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const run of runs) {
|
||||||
|
await toolchains.configureToolchains(
|
||||||
|
run.version,
|
||||||
|
run.distributionName,
|
||||||
|
run.jdkHome,
|
||||||
|
undefined
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
||||||
|
const contents = fs.readFileSync(toolchainsFile, 'utf-8');
|
||||||
|
|
||||||
|
for (const run of runs) {
|
||||||
|
expect(contents).toContain(`<id>${run.id}</id>`);
|
||||||
|
expect(contents).toContain(`<jdkHome>${run.jdkHome}</jdkHome>`);
|
||||||
|
}
|
||||||
|
// Exactly one <toolchain> entry per run – no duplicates, none dropped.
|
||||||
|
expect((contents.match(/<toolchain>/g) || []).length).toBe(runs.length);
|
||||||
|
}, 100000);
|
||||||
});
|
});
|
||||||
|
|||||||
+163
-14
@@ -1,19 +1,64 @@
|
|||||||
import * as cache from '@actions/cache';
|
import {
|
||||||
import * as core from '@actions/core';
|
jest,
|
||||||
|
describe,
|
||||||
|
it,
|
||||||
|
expect,
|
||||||
|
beforeEach,
|
||||||
|
afterAll,
|
||||||
|
afterEach
|
||||||
|
} from '@jest/globals';
|
||||||
|
import {fileURLToPath} from 'url';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {
|
|
||||||
|
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 {
|
||||||
convertVersionToSemver,
|
convertVersionToSemver,
|
||||||
getNextPageUrlFromLinkHeader,
|
getNextPageUrlFromLinkHeader,
|
||||||
getVersionFromFileContent,
|
getVersionFromFileContent,
|
||||||
isVersionSatisfies,
|
isVersionSatisfies,
|
||||||
isCacheFeatureAvailable,
|
isCacheFeatureAvailable,
|
||||||
isGhes,
|
isGhes,
|
||||||
validatePaginationUrl
|
validatePaginationUrl,
|
||||||
} from '../src/util';
|
getLatestMajorVersion
|
||||||
|
} = await import('../src/util.js');
|
||||||
jest.mock('@actions/cache');
|
|
||||||
jest.mock('@actions/core');
|
|
||||||
|
|
||||||
describe('isVersionSatisfies', () => {
|
describe('isVersionSatisfies', () => {
|
||||||
it.each([
|
it.each([
|
||||||
@@ -45,8 +90,10 @@ describe('isVersionSatisfies', () => {
|
|||||||
|
|
||||||
describe('isCacheFeatureAvailable', () => {
|
describe('isCacheFeatureAvailable', () => {
|
||||||
it('isCacheFeatureAvailable disabled on GHES', () => {
|
it('isCacheFeatureAvailable disabled on GHES', () => {
|
||||||
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
|
(cache.isFeatureAvailable as jest.Mock<any>).mockImplementation(
|
||||||
const infoMock = jest.spyOn(core, 'warning');
|
() => false
|
||||||
|
);
|
||||||
|
const infoMock = core.warning as jest.Mock;
|
||||||
const message =
|
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.';
|
'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 {
|
try {
|
||||||
@@ -59,8 +106,10 @@ describe('isCacheFeatureAvailable', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('isCacheFeatureAvailable disabled on dotcom', () => {
|
it('isCacheFeatureAvailable disabled on dotcom', () => {
|
||||||
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
|
(cache.isFeatureAvailable as jest.Mock<any>).mockImplementation(
|
||||||
const infoMock = jest.spyOn(core, 'warning');
|
() => false
|
||||||
|
);
|
||||||
|
const infoMock = core.warning as jest.Mock;
|
||||||
const message =
|
const message =
|
||||||
'The runner was not able to contact the cache service. Caching will be skipped';
|
'The runner was not able to contact the cache service. Caching will be skipped';
|
||||||
try {
|
try {
|
||||||
@@ -73,9 +122,14 @@ describe('isCacheFeatureAvailable', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('isCacheFeatureAvailable is enabled', () => {
|
it('isCacheFeatureAvailable is enabled', () => {
|
||||||
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => true);
|
(cache.isFeatureAvailable as jest.Mock<any>).mockImplementation(() => true);
|
||||||
expect(isCacheFeatureAvailable()).toBe(true);
|
expect(isCacheFeatureAvailable()).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.resetAllMocks();
|
||||||
|
jest.clearAllMocks();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('convertVersionToSemver', () => {
|
describe('convertVersionToSemver', () => {
|
||||||
@@ -243,13 +297,78 @@ 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', () => {
|
describe('isGhes', () => {
|
||||||
const pristineEnv = process.env;
|
const pristineEnv = process.env;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.resetModules();
|
|
||||||
process.env = {...pristineEnv};
|
process.env = {...pristineEnv};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -282,3 +401,33 @@ describe('isGhes', () => {
|
|||||||
expect(isGhes()).toBeTruthy();
|
expect(isGhes()).toBeTruthy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('getLatestMajorVersion', () => {
|
||||||
|
const makeHttp = (getJson: jest.Mock) =>
|
||||||
|
({getJson}) as unknown as import('@actions/http-client').HttpClient;
|
||||||
|
|
||||||
|
it('returns most_recent_feature_release from the Adoptium API', async () => {
|
||||||
|
const getJson = jest.fn(async () => ({
|
||||||
|
statusCode: 200,
|
||||||
|
result: {most_recent_feature_release: 25},
|
||||||
|
headers: {}
|
||||||
|
}));
|
||||||
|
|
||||||
|
await expect(getLatestMajorVersion(makeHttp(getJson))).resolves.toBe(25);
|
||||||
|
expect(getJson).toHaveBeenCalledWith(
|
||||||
|
'https://api.adoptium.net/v3/info/available_releases'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('throws when the response does not contain a usable value', async () => {
|
||||||
|
const getJson = jest.fn(async () => ({
|
||||||
|
statusCode: 200,
|
||||||
|
result: {},
|
||||||
|
headers: {}
|
||||||
|
}));
|
||||||
|
|
||||||
|
await expect(getLatestMajorVersion(makeHttp(getJson))).rejects.toThrow(
|
||||||
|
'Could not determine the latest available Java major version'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
+13
-3
@@ -4,7 +4,7 @@ description: 'Set up a specific version of the Java JDK and add the
|
|||||||
author: 'GitHub'
|
author: 'GitHub'
|
||||||
inputs:
|
inputs:
|
||||||
java-version:
|
java-version:
|
||||||
description: 'The Java version to set up. Takes a whole or semver Java version. See examples of supported syntax in README file'
|
description: 'The Java version to set up. Takes a whole or semver Java version, or the "latest" alias to use the newest available stable release. See examples of supported syntax in README file'
|
||||||
required: false
|
required: false
|
||||||
java-version-file:
|
java-version-file:
|
||||||
description: 'The path to a file containing the Java version to set up (.java-version, .tool-versions, .sdkmanrc). Used when java-version is not set. See examples of supported syntax in README file'
|
description: 'The path to a file containing the Java version to set up (.java-version, .tool-versions, .sdkmanrc). Used when java-version is not set. See examples of supported syntax in README file'
|
||||||
@@ -13,15 +13,19 @@ 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).'
|
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
|
required: false
|
||||||
java-package:
|
java-package:
|
||||||
description: 'The package type (jdk, jre, jdk+fx, jre+fx)'
|
description: 'The package type (jdk, jre, jdk+fx, jre+fx, jdk+crac, jre+crac)'
|
||||||
required: false
|
required: false
|
||||||
default: 'jdk'
|
default: 'jdk'
|
||||||
architecture:
|
architecture:
|
||||||
description: "The architecture of the package (defaults to the action runner's architecture)"
|
description: "The architecture of the package (defaults to the action runner's architecture)"
|
||||||
required: false
|
required: false
|
||||||
jdkFile:
|
jdk-file:
|
||||||
description: 'Path to where the compressed JDK is located'
|
description: 'Path to where the compressed JDK is located'
|
||||||
required: false
|
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:
|
check-latest:
|
||||||
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec'
|
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec'
|
||||||
required: false
|
required: false
|
||||||
@@ -90,6 +94,10 @@ inputs:
|
|||||||
description: 'Whether Maven should print artifact download/transfer progress to the build log. When "false" (default) the action sets "-ntp" (--no-transfer-progress) in MAVEN_ARGS to produce cleaner logs. Set to "true" to keep the progress output. Has no effect on non-Maven builds.'
|
description: 'Whether Maven should print artifact download/transfer progress to the build log. When "false" (default) the action sets "-ntp" (--no-transfer-progress) in MAVEN_ARGS to produce cleaner logs. Set to "true" to keep the progress output. Has no effect on non-Maven builds.'
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
|
problem-matcher:
|
||||||
|
description: 'Whether to register the Java problem matcher (compiler errors/warnings and uncaught exceptions). Set to "false" to disable annotations.'
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
outputs:
|
outputs:
|
||||||
distribution:
|
distribution:
|
||||||
description: 'Distribution of Java that has been installed'
|
description: 'Distribution of Java that has been installed'
|
||||||
@@ -99,6 +107,8 @@ outputs:
|
|||||||
description: 'Path to where the java environment has been installed (same as $JAVA_HOME)'
|
description: 'Path to where the java environment has been installed (same as $JAVA_HOME)'
|
||||||
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'
|
||||||
|
cache-primary-key:
|
||||||
|
description: 'The primary cache key computed by the action for the configured build tool. Empty when caching is not enabled or when caching is skipped (e.g. cache service unavailable). Useful for composing with actions/cache or actions/cache/restore across jobs.'
|
||||||
runs:
|
runs:
|
||||||
using: 'node24'
|
using: 'node24'
|
||||||
main: 'dist/setup/index.js'
|
main: 'dist/setup/index.js'
|
||||||
|
|||||||
Vendored
+62159
-56281
File diff suppressed because one or more lines are too long
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
Vendored
+70665
-65612
File diff suppressed because one or more lines are too long
Vendored
+3
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"type": "module"
|
||||||
|
}
|
||||||
+359
-152
@@ -4,6 +4,7 @@
|
|||||||
- [Adopt](#Adopt)
|
- [Adopt](#Adopt)
|
||||||
- [Zulu](#Zulu)
|
- [Zulu](#Zulu)
|
||||||
- [Liberica](#Liberica)
|
- [Liberica](#Liberica)
|
||||||
|
- [Liberica Native Image Kit](#Liberica-Native-Image-Kit)
|
||||||
- [Microsoft](#Microsoft)
|
- [Microsoft](#Microsoft)
|
||||||
- [Amazon Corretto](#Amazon-Corretto)
|
- [Amazon Corretto](#Amazon-Corretto)
|
||||||
- [Oracle](#Oracle)
|
- [Oracle](#Oracle)
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
- [Tencent Kona](#Tencent-Kona)
|
- [Tencent Kona](#Tencent-Kona)
|
||||||
- [Installing custom Java package type](#Installing-custom-Java-package-type)
|
- [Installing custom Java package type](#Installing-custom-Java-package-type)
|
||||||
- [JavaFX Maven project](#JavaFX-Maven-project)
|
- [JavaFX Maven project](#JavaFX-Maven-project)
|
||||||
|
- [Ensuring the Maven cache is complete (plugin dependencies)](#ensuring-the-maven-cache-is-complete-plugin-dependencies)
|
||||||
- [Installing custom Java architecture](#Installing-custom-Java-architecture)
|
- [Installing custom Java architecture](#Installing-custom-Java-architecture)
|
||||||
- [Installing JDK without setting as default](#Installing-JDK-without-setting-as-default)
|
- [Installing JDK without setting as default](#Installing-JDK-without-setting-as-default)
|
||||||
- [Installing custom Java distribution from local file](#Installing-Java-from-local-file)
|
- [Installing custom Java distribution from local file](#Installing-Java-from-local-file)
|
||||||
@@ -37,12 +39,12 @@ Inputs `java-version` and `distribution` are mandatory and needs to be provided.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Adopt
|
### Adopt
|
||||||
@@ -50,50 +52,64 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'adopt-hotspot'
|
distribution: 'adopt-hotspot'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Zulu
|
### Zulu
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
|
java-package: jdk # optional (jdk, jre, jdk+fx, jre+fx, jdk+crac, or jre+crac) - defaults to jdk
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Liberica
|
### Liberica
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'liberica'
|
distribution: 'liberica'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
|
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
|
||||||
- run: java --version
|
- run: java --version
|
||||||
|
```
|
||||||
|
|
||||||
|
### Liberica Native Image Kit
|
||||||
|
Liberica Native Image Kit (NIK) is a GraalVM-based distribution. `java-version` selects the underlying JDK version (e.g. `17`, `21`, `25`). Use `java-package: jdk+fx` to get the `full` bundle with JavaFX/Swing support; otherwise the `standard` bundle (with extra languages) is installed. Available on Linux, macOS and Windows for `x64` and `aarch64`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: 'liberica-nik'
|
||||||
|
java-version: '25'
|
||||||
|
java-package: jdk # optional (jdk or jdk+fx) - defaults to jdk
|
||||||
|
- run: native-image --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Microsoft
|
### Microsoft
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'microsoft'
|
distribution: 'microsoft'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using Microsoft distribution on GHES
|
### Using Microsoft distribution on GHES
|
||||||
@@ -103,11 +119,11 @@ steps:
|
|||||||
To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` input for the action:
|
To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` input for the action:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GH_DOTCOM_TOKEN }}
|
token: ${{ secrets.GH_DOTCOM_TOKEN }}
|
||||||
distribution: 'microsoft'
|
distribution: 'microsoft'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
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.
|
||||||
@@ -117,12 +133,12 @@ If the runner is not able to access github.com, any Java versions requested duri
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'corretto'
|
distribution: 'corretto'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Oracle
|
### Oracle
|
||||||
@@ -130,12 +146,12 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'oracle'
|
distribution: 'oracle'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### Alibaba Dragonwell
|
### Alibaba Dragonwell
|
||||||
@@ -143,24 +159,24 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'dragonwell'
|
distribution: 'dragonwell'
|
||||||
java-version: '8'
|
java-version: '8'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### SapMachine
|
### SapMachine
|
||||||
**NOTE:** An OpenJDK release maintained and supported by SAP
|
**NOTE:** An OpenJDK release maintained and supported by SAP
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'sapmachine'
|
distribution: 'sapmachine'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### GraalVM
|
### GraalVM
|
||||||
@@ -168,12 +184,12 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'graalvm'
|
distribution: 'graalvm'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
- run: |
|
- run: |
|
||||||
java --version
|
java --version
|
||||||
native-image --version
|
native-image --version
|
||||||
```
|
```
|
||||||
@@ -183,12 +199,12 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'graalvm-community'
|
distribution: 'graalvm-community'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
- run: |
|
- run: |
|
||||||
java --version
|
java --version
|
||||||
native-image --version
|
native-image --version
|
||||||
```
|
```
|
||||||
@@ -202,12 +218,12 @@ For example, `11.0.24` is not available but `11.0.16` is.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'jetbrains'
|
distribution: 'jetbrains'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
The JetBrains installer uses the GitHub API to fetch the latest version. If you believe your project is going to be running into rate limits, you can provide a
|
The JetBrains installer uses the GitHub API to fetch the latest version. If you believe your project is going to be running into rate limits, you can provide a
|
||||||
@@ -215,15 +231,15 @@ GitHub token to the action to increase the rate limit. Set the `GITHUB_TOKEN` en
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'jetbrains'
|
distribution: 'jetbrains'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
java-package: 'jdk' # optional (jdk, jre, jdk+jcef, jre+jcef, jdk+ft, or jre+ft) - defaults to jdk
|
java-package: 'jdk' # optional (jdk, jre, jdk+jcef, jre+jcef, jdk+ft, or jre+ft) - defaults to jdk
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
You can specify your package type (as shown in the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases/)) in the `java-package` parameter.
|
You can specify your package type (as shown in the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases/)) in the `java-package` parameter.
|
||||||
@@ -237,28 +253,28 @@ The available package types are:
|
|||||||
- `jre+ft` - JBR (FreeType)
|
- `jre+ft` - JBR (FreeType)
|
||||||
|
|
||||||
### Tencent Kona
|
### Tencent Kona
|
||||||
**NOTE:** Tencent Kona supports major versions 8, 11, 17 and 21, and provides jdk only.
|
**NOTE:** Tencent Kona supports major versions 8, 11, 17, 21 and 25, and provides jdk only.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'kona'
|
distribution: 'kona'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installing custom Java package type
|
## Installing custom Java package type
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '11'
|
java-version: '25'
|
||||||
java-package: jdk # optional (jdk or jre) - defaults to jdk
|
java-package: jdk # optional (jdk or jre) - defaults to jdk
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### JavaFX Maven project
|
### JavaFX Maven project
|
||||||
@@ -267,14 +283,14 @@ For JavaFX projects that use Maven, use `jdk+fx` (or `jre+fx`) as the `java-pack
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
java-version: '21'
|
java-version: '25'
|
||||||
java-package: jdk+fx
|
java-package: jdk+fx
|
||||||
cache: maven
|
cache: maven
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn --no-transfer-progress compile
|
run: mvn --no-transfer-progress compile
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -285,17 +301,140 @@ To run the JavaFX application in CI:
|
|||||||
run: mvn --no-transfer-progress javafx:run
|
run: mvn --no-transfer-progress javafx:run
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Ensuring the Maven cache is complete (plugin dependencies)
|
||||||
|
|
||||||
|
When you enable `cache: maven`, the action caches your local Maven repository
|
||||||
|
(`~/.m2/repository`). The cache key is a hash of your Maven inputs — every
|
||||||
|
`**/pom.xml`, plus `**/.mvn/wrapper/maven-wrapper.properties` and
|
||||||
|
`**/.mvn/extensions.xml` — so changing any of those files (for example bumping
|
||||||
|
the wrapper version or editing core extensions) produces a new key and
|
||||||
|
invalidates the cache. At the end of the job the action saves whatever was
|
||||||
|
downloaded during that run. It does **not** re-save the cache when the key
|
||||||
|
already matches (a cache *hit*).
|
||||||
|
|
||||||
|
Downloaded Maven Wrapper distributions (`~/.m2/wrapper/dists`) are cached in a
|
||||||
|
**separate** cache entry keyed only on `**/.mvn/wrapper/maven-wrapper.properties`.
|
||||||
|
Because the wrapper distribution changes far less often than your `pom.xml`
|
||||||
|
files, this keeps it available across the frequent dependency changes that
|
||||||
|
rotate the main cache key, so wrapper-based (`./mvnw`) builds don't re-download
|
||||||
|
the Maven distribution on every dependency change. See
|
||||||
|
[issue #1095](https://github.com/actions/setup-java/issues/1095).
|
||||||
|
|
||||||
|
Maven resolves **plugin** dependencies lazily: it only downloads the plugins and
|
||||||
|
plugin dependencies required by the goals that actually execute. As a result, the
|
||||||
|
run that first creates the cache determines what is stored. If that run executed a
|
||||||
|
"thin" goal such as `mvn compile`, plugins bound to later phases are never
|
||||||
|
resolved. For example, `maven-shade-plugin` (bound to `package`) pulls in
|
||||||
|
`plexus-archiver`, `commons-compress`, `io.airlift:aircompressor` and
|
||||||
|
`org.tukaani:xz` — none of which a `compile` run downloads. Those artifacts are
|
||||||
|
therefore absent from the cache, and because the action does not re-save on a
|
||||||
|
hit, every later `test`/`verify`/`package` job re-downloads them on every run.
|
||||||
|
|
||||||
|
### Seed the cache with a resolution step
|
||||||
|
|
||||||
|
To populate `~/.m2` as comprehensively as possible on the run that creates the
|
||||||
|
cache, run a dependency-resolution "seed" command before your build. Choose a
|
||||||
|
command based on how thorough you need it to be:
|
||||||
|
|
||||||
|
| Seed command | Resolves plugin dependencies? | Notes |
|
||||||
|
|--------------|:-----------------------------:|-------|
|
||||||
|
| `mvn dependency:resolve` | No | Resolves project dependencies only — misses plugin dependencies (e.g. `aircompressor`). |
|
||||||
|
| `mvn dependency:resolve-plugins` | Yes | Resolves plugins **and their dependencies**. |
|
||||||
|
| `mvn dependency:go-offline` | Yes | Resolves project and plugin dependencies (a superset). |
|
||||||
|
| `mvn dependency:go-offline dependency:resolve-plugins` | Yes (most thorough) | Recommended default. Use `dependency:resolve dependency:resolve-plugins` if `go-offline` is flaky or insufficient for your project. |
|
||||||
|
|
||||||
|
Single job — seed, then build (the cache saved at the end of this run contains
|
||||||
|
the full set):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '25'
|
||||||
|
cache: 'maven'
|
||||||
|
- name: Seed the Maven cache
|
||||||
|
run: mvn dependency:go-offline dependency:resolve-plugins
|
||||||
|
- name: Build with Maven
|
||||||
|
run: mvn verify --file pom.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
Separate seed job — useful for a matrix where different legs run different goals
|
||||||
|
(`test`, `check`, `verify`, `-Pprofile1`, ...) but all share the same `~/.m2`
|
||||||
|
cache. Without a seed, whichever job finishes first creates the cache from its
|
||||||
|
own partial `.m2`, and parallel jobs race to save an equally partial cache; the
|
||||||
|
seed job instead creates one comprehensive cache that every other job reuses:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
seed-cache:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '25'
|
||||||
|
cache: 'maven'
|
||||||
|
- name: Seed the Maven cache
|
||||||
|
run: mvn dependency:go-offline dependency:resolve-plugins
|
||||||
|
|
||||||
|
build:
|
||||||
|
needs: seed-cache
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
goal: ['test', 'verify', 'test -Pprofile1']
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v7
|
||||||
|
- uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '25'
|
||||||
|
cache: 'maven'
|
||||||
|
- name: Build
|
||||||
|
run: mvn ${{ matrix.goal }} --file pom.xml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Caveats
|
||||||
|
|
||||||
|
- **The seed only helps on the run that creates the cache.** Once a cache exists
|
||||||
|
for the current `pom.xml` hash, later runs get a hit and any additional
|
||||||
|
downloads are not saved. On an existing repository whose cache is already
|
||||||
|
incomplete, invalidate it once (for example by changing `cache-dependency-path`
|
||||||
|
or deleting the repository's caches) so a complete cache is created from the
|
||||||
|
seed.
|
||||||
|
- **Static resolution is not exhaustive.** `go-offline`/`resolve-plugins` resolve
|
||||||
|
the statically declared plugin set for the *active* profiles and modules.
|
||||||
|
Profile-gated plugins, conditionally-active modules, and artifacts a plugin
|
||||||
|
fetches at execution time may still be missed. For the most complete cache,
|
||||||
|
seed with the fullest goal set your CI actually uses (for example
|
||||||
|
`mvn verify` with every profile enabled).
|
||||||
|
- **Multi-module projects:** run the seed at the reactor root so every module's
|
||||||
|
plugins are resolved.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> The same "the cache stores only what the creating run downloaded, and is not
|
||||||
|
> re-saved on a hit" behavior applies to `cache: gradle`, since Gradle also
|
||||||
|
> resolves dependencies and plugin/buildscript classpaths lazily. Gradle has no
|
||||||
|
> direct equivalent of `dependency:go-offline`, so for complete and fine-grained
|
||||||
|
> dependency caching on Gradle projects we recommend
|
||||||
|
> [`gradle/actions/setup-gradle`](https://github.com/gradle/actions/tree/main/setup-gradle),
|
||||||
|
> which provides purpose-built caching (see the
|
||||||
|
> [setup-gradle documentation](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md)).
|
||||||
|
|
||||||
## Installing custom Java architecture
|
## Installing custom Java architecture
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '11'
|
java-version: '25'
|
||||||
architecture: x86 # optional - default value derived from the runner machine
|
architecture: x86 # optional - default value derived from the runner machine
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
## Installing JDK without setting as default
|
## Installing JDK without setting as default
|
||||||
@@ -304,18 +443,18 @@ When installing multiple JDKs, the last one installed becomes the default (`JAVA
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
id: setup-java-21
|
id: setup-java-21
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
set-default: false
|
set-default: false
|
||||||
- run: |
|
- run: |
|
||||||
echo "Default java:"
|
echo "Default java:"
|
||||||
java -version
|
java -version
|
||||||
echo "Java 21 home: $JAVA_HOME_21_X64"
|
echo "Java 21 home: $JAVA_HOME_21_X64"
|
||||||
@@ -330,44 +469,44 @@ 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:
|
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]
|
> [!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 `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).
|
> 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).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
download_url="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz"
|
download_url="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz"
|
||||||
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||||
java-version: '11.0.0'
|
java-version: '11.0.0'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
|
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
For example, to use an **Early Access** build from [jdk.java.net](https://jdk.java.net/), download the archive for your runner OS/architecture and install it via `distribution: 'jdkfile'` (example below assumes Linux x64):
|
For example, to use an **Early Access** build from [jdk.java.net](https://jdk.java.net/), download the archive for your runner OS/architecture and install it via `distribution: 'jdkfile'` (example below assumes Linux x64):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
download_url="https://download.java.net/java/early_access/jdk25/36/GPL/openjdk-25-ea+36_linux-x64_bin.tar.gz"
|
download_url="https://download.java.net/java/early_access/jdk25/36/GPL/openjdk-25-ea+36_linux-x64_bin.tar.gz"
|
||||||
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||||
java-version: '25.0.0-ea.36'
|
java-version: '25.0.0-ea.36'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
|
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
If your use-case requires a custom distribution (in the example, alpine-linux is used) or a version that is not provided by setup-java and you want to always install the latest version during runtime, then you can use the following code to auto-download the latest JDK, determine the semver needed for setup-java, and setup-java will take care of the installation and caching on the VM:
|
If your use-case requires a custom distribution (in the example, alpine-linux is used) or a version that is not provided by setup-java and you want to always install the latest version during runtime, then you can use the following code to auto-download the latest JDK, determine the semver needed for setup-java, and setup-java will take care of the installation and caching on the VM:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- name: fetch latest temurin JDK
|
- name: fetch latest temurin JDK
|
||||||
id: fetch_latest_jdk
|
id: fetch_latest_jdk
|
||||||
run: |
|
run: |
|
||||||
@@ -380,10 +519,10 @@ If your use-case requires a custom distribution (in the example, alpine-linux is
|
|||||||
latest_semver_version=$(curl -sL $latest_jdk_json_url | jq -r 'version.semver')
|
latest_semver_version=$(curl -sL $latest_jdk_json_url | jq -r 'version.semver')
|
||||||
echo "java_version=$latest_semver_version" >> "$GITHUB_OUTPUT"
|
echo "java_version=$latest_semver_version" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||||
java-version: {{ steps.fetch_latest_jdk.outputs.java_version }}
|
java-version: {{ steps.fetch_latest_jdk.outputs.java_version }}
|
||||||
architecture: x64
|
architecture: x64
|
||||||
- run: java --version
|
- run: java --version
|
||||||
@@ -401,9 +540,9 @@ jobs:
|
|||||||
java: [ '8', '11' ]
|
java: [ '8', '11' ]
|
||||||
name: Java ${{ matrix.Java }} (${{ matrix.distribution }}) sample
|
name: Java ${{ matrix.Java }} (${{ matrix.distribution }}) sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Setup java
|
- name: Setup java
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
@@ -421,9 +560,9 @@ jobs:
|
|||||||
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
|
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
|
||||||
name: Java ${{ matrix.Java }} (${{ matrix.os }}) sample
|
name: Java ${{ matrix.Java }} (${{ matrix.os }}) sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Setup java
|
- name: Setup java
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
@@ -438,15 +577,15 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn package --file pom.xml
|
||||||
|
|
||||||
- name: Publish to GitHub Packages Apache Maven
|
- name: Publish to GitHub Packages Apache Maven
|
||||||
run: mvn deploy
|
run: mvn deploy
|
||||||
@@ -454,21 +593,20 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
|
GITHUB_TOKEN: ${{ github.token }} # GITHUB_TOKEN is the default env for the password
|
||||||
|
|
||||||
- name: Set up Apache Maven Central
|
- name: Set up Apache Maven Central
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with: # running setup-java again overwrites the settings.xml
|
with: # running setup-java again overwrites the settings.xml
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
|
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
|
||||||
server-username: MAVEN_USERNAME # env variable for username in deploy
|
server-username: MAVEN_USERNAME # env variable for username in deploy
|
||||||
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
|
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
|
||||||
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
|
|
||||||
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
|
|
||||||
|
|
||||||
- name: Publish to Apache Maven Central
|
- name: Publish to Apache Maven Central
|
||||||
run: mvn deploy
|
run: mvn deploy -Dgpg.signer=bc # requires maven-gpg-plugin >= 3.2.0 (bc signer support)
|
||||||
env:
|
env:
|
||||||
MAVEN_USERNAME: maven_username123
|
MAVEN_USERNAME: maven_username123
|
||||||
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
|
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
|
||||||
|
MAVEN_GPG_KEY: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # ASCII-armored secret key (TSK), e.g. from `gpg --armor --export-secret-keys YOUR_ID`
|
||||||
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
|
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -486,10 +624,6 @@ The two `settings.xml` files created from the above example look like the follow
|
|||||||
<username>${env.GITHUB_ACTOR}</username>
|
<username>${env.GITHUB_ACTOR}</username>
|
||||||
<password>${env.GITHUB_TOKEN}</password>
|
<password>${env.GITHUB_TOKEN}</password>
|
||||||
</server>
|
</server>
|
||||||
<server>
|
|
||||||
<id>gpg.passphrase</id>
|
|
||||||
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
|
|
||||||
</server>
|
|
||||||
</servers>
|
</servers>
|
||||||
</settings>
|
</settings>
|
||||||
```
|
```
|
||||||
@@ -506,10 +640,6 @@ The two `settings.xml` files created from the above example look like the follow
|
|||||||
<username>${env.MAVEN_USERNAME}</username>
|
<username>${env.MAVEN_USERNAME}</username>
|
||||||
<password>${env.MAVEN_CENTRAL_TOKEN}</password>
|
<password>${env.MAVEN_CENTRAL_TOKEN}</password>
|
||||||
</server>
|
</server>
|
||||||
<server>
|
|
||||||
<id>gpg.passphrase</id>
|
|
||||||
<passphrase>${env.MAVEN_GPG_PASSPHRASE}</passphrase>
|
|
||||||
</server>
|
|
||||||
</servers>
|
</servers>
|
||||||
</settings>
|
</settings>
|
||||||
```
|
```
|
||||||
@@ -520,9 +650,64 @@ The two `settings.xml` files created from the above example look like the follow
|
|||||||
|
|
||||||
If you don't want to overwrite the `settings.xml` file, you can set `overwrite-settings: false`
|
If you don't want to overwrite the `settings.xml` file, you can set `overwrite-settings: false`
|
||||||
|
|
||||||
### Extra setup for pom.xml:
|
### GPG
|
||||||
|
|
||||||
The Maven GPG Plugin configuration in the pom.xml file should contain the following structure to avoid possible issues like `Inappropriate ioctl for device` or `gpg: signing failed: No such file or directory`:
|
The example above uses the [Maven GPG Plugin](https://maven.apache.org/plugins/maven-gpg-plugin/)'s Bouncy Castle signer (`-Dgpg.signer=bc`, available since `maven-gpg-plugin` 3.2.0). It is a pure-Java signer that reads the key directly from the `MAVEN_GPG_KEY` environment variable, so it does **not** require the `gpg` executable, importing the key into a GPG keychain, or the `--pinentry-mode loopback` workaround in your `pom.xml`. The key must be an ASCII-armored secret key (transferable secret key format).
|
||||||
|
|
||||||
|
**GPG key should be exported by: `gpg --armor --export-secret-keys YOUR_ID`**
|
||||||
|
|
||||||
|
See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file.
|
||||||
|
|
||||||
|
#### Legacy / alternative: let setup-java import the key
|
||||||
|
|
||||||
|
If you prefer signing with the `gpg` executable (for example because you are using `maven-gpg-plugin` older than 3.2.0), you can let setup-java import the key instead by providing the `gpg-private-key` and `gpg-passphrase` inputs. The private key is written to a file in the runner's temp directory, imported into the GPG keychain, and the file is promptly removed before proceeding with the rest of the setup process. A cleanup step removes the imported private key from the GPG keychain after the job completes regardless of the job status. This ensures that the private key is no longer accessible on self-hosted runners and cannot "leak" between jobs (hosted runners are always clean instances).
|
||||||
|
|
||||||
|
setup-java imports the key independently of the plugin version, but the generated passphrase profile described below uses `gpg.passphraseEnvName`, which requires `maven-gpg-plugin` 3.2.0 or newer. Since `gpg-passphrase` defaults to `GPG_PASSPHRASE`, setup-java writes that profile unless you override the input to `MAVEN_GPG_PASSPHRASE`.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- name: Set up Apache Maven Central
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
distribution: 'temurin'
|
||||||
|
java-version: '11'
|
||||||
|
server-id: maven # Value of the distributionManagement/repository/id field of the pom.xml
|
||||||
|
server-username: MAVEN_USERNAME # env variable for username in deploy
|
||||||
|
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy
|
||||||
|
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
|
||||||
|
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase
|
||||||
|
|
||||||
|
- name: Publish to Apache Maven Central
|
||||||
|
run: mvn deploy
|
||||||
|
env:
|
||||||
|
MAVEN_USERNAME: maven_username123
|
||||||
|
MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_CENTRAL_TOKEN }}
|
||||||
|
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `gpg-passphrase` input is the **name of the environment variable** that holds the passphrase (not the passphrase itself). It defaults to `GPG_PASSPHRASE`. The [Maven GPG Plugin](https://maven.apache.org/plugins/maven-gpg-plugin/) reads the passphrase from the environment variable named by its `gpg.passphraseEnvName` property, whose own default is `MAVEN_GPG_PASSPHRASE`.
|
||||||
|
|
||||||
|
- If `gpg-passphrase` is `MAVEN_GPG_PASSPHRASE`, the plugin already reads that variable by default, so setup-java writes nothing extra to `settings.xml`.
|
||||||
|
- Otherwise (including the default `GPG_PASSPHRASE`), setup-java configures `gpg.passphraseEnvName` through an active profile in the generated `settings.xml` so the plugin reads the passphrase from that variable. For the default `gpg-passphrase: GPG_PASSPHRASE`:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>setup-java-gpg</id>
|
||||||
|
<properties>
|
||||||
|
<gpg.passphraseEnvName>GPG_PASSPHRASE</gpg.passphraseEnvName>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
<activeProfiles>
|
||||||
|
<activeProfile>setup-java-gpg</activeProfile>
|
||||||
|
</activeProfiles>
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Note:** Earlier versions of setup-java wrote a `gpg.passphrase` server to `settings.xml`. That mechanism is deprecated by the Maven GPG Plugin and fails when its `bestPractices` mode is enabled, so setup-java now relies on `gpg.passphraseEnvName` instead. The `gpg-passphrase` input and its `GPG_PASSPHRASE` default are unchanged, so existing workflows that set the `GPG_PASSPHRASE` environment variable keep working.
|
||||||
|
|
||||||
|
> **Compatibility note:** Reading the passphrase from an environment variable (`gpg.passphraseEnvName`) requires `maven-gpg-plugin` 3.2.0 or newer. Older versions do not honor this property and will not pick up the passphrase, because setup-java no longer writes the deprecated `gpg.passphrase` server to `settings.xml`. If you are pinned to `maven-gpg-plugin` older than 3.2.0, upgrade to 3.2.0+.
|
||||||
|
|
||||||
|
When signing with the `gpg` executable, the Maven GPG Plugin configuration in your `pom.xml` should contain the following structure to avoid possible issues like `Inappropriate ioctl for device` or `gpg: signing failed: No such file or directory`:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<configuration>
|
<configuration>
|
||||||
@@ -533,17 +718,10 @@ The Maven GPG Plugin configuration in the pom.xml file should contain the follow
|
|||||||
</gpgArguments>
|
</gpgArguments>
|
||||||
</configuration>
|
</configuration>
|
||||||
```
|
```
|
||||||
GPG 2.1 requires `--pinentry-mode` to be set to `loopback` in order to pick up the `gpg.passphrase` value defined in Maven `settings.xml`.
|
|
||||||
|
|
||||||
### GPG
|
GPG 2.1 requires `--pinentry-mode` to be set to `loopback` in order to read the passphrase non-interactively.
|
||||||
|
|
||||||
If `gpg-private-key` input is provided, the private key will be written to a file in the runner's temp directory, the private key file will be imported into the GPG keychain, and then the file will be promptly removed before proceeding with the rest of the setup process. A cleanup step will remove the imported private key from the GPG keychain after the job completes regardless of the job status. This ensures that the private key is no longer accessible on self-hosted runners and cannot "leak" between jobs (hosted runners are always clean instances).
|
***NOTE***: If, when using the default `gpg` signer, the error `gpg: Sorry, no terminal at all requested - can't get input` [is encountered](https://github.com/actions/setup-java/issues/554), please update the version of `maven-gpg-plugin` to 1.6 or higher.
|
||||||
|
|
||||||
**GPG key should be exported by: `gpg --armor --export-secret-keys YOUR_ID`**
|
|
||||||
|
|
||||||
See the help docs on [Publishing a Package](https://help.github.com/en/github/managing-packages-with-github-packages/configuring-apache-maven-for-use-with-github-packages#publishing-a-package) for more information on the `pom.xml` file.
|
|
||||||
|
|
||||||
***NOTE***: If the error that states, `gpg: Sorry, no terminal at all requested - can't get input` [is encountered](https://github.com/actions/setup-java/issues/554), please update the version of `maven-gpg-plugin` to 1.6 or higher.
|
|
||||||
|
|
||||||
## Apache Maven with a settings path
|
## Apache Maven with a settings path
|
||||||
|
|
||||||
@@ -555,9 +733,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- name: Set up JDK 11 for Shared Runner
|
- name: Set up JDK 11 for Shared Runner
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
@@ -565,7 +743,7 @@ jobs:
|
|||||||
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
settings-path: ${{ github.workspace }} # location for the settings.xml file
|
||||||
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn package --file pom.xml
|
||||||
|
|
||||||
- name: Publish to GitHub Packages Apache Maven
|
- name: Publish to GitHub Packages Apache Maven
|
||||||
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
|
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
|
||||||
@@ -587,34 +765,35 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
show-download-progress: true # keep Maven download/transfer progress in the logs
|
show-download-progress: true # keep Maven download/transfer progress in the logs
|
||||||
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn package --file pom.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
***NOTES***:
|
***NOTES***:
|
||||||
- `MAVEN_ARGS` is honored by Maven 3.9.0+ and the Maven Wrapper (`mvnw`). Older Maven versions ignore it, so on those you can pass `--no-transfer-progress` on the command line instead.
|
- `MAVEN_ARGS` is honored by Maven 3.9.0+ and the Maven Wrapper (`mvnw`). Older Maven versions ignore it, so on those you can pass `--no-transfer-progress` on the command line instead.
|
||||||
- This setting only affects Maven. It has no effect on Gradle, sbt, or other build tools.
|
- This setting only affects Maven. It has no effect on Gradle, sbt, or other build tools.
|
||||||
- `-ntp` only controls transfer/progress output; it does not change whether Maven runs in batch mode. Use `-B`/`--batch-mode` (or `<interactiveMode>false</interactiveMode>` in `settings.xml`) if you also want non-interactive runs.
|
- `-ntp` only controls transfer/progress output. The `settings.xml` generated by `setup-java` separately sets `<interactiveMode>false</interactiveMode>`. If you use `overwrite-settings: false`, ensure your existing settings disable interactive mode or pass `-B`/`--batch-mode`.
|
||||||
|
|
||||||
## Java problem matcher (compiler annotations)
|
## Java problem matcher (compiler annotations)
|
||||||
|
|
||||||
`setup-java` registers a [problem matcher](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) for Java after installing the JDK. It scans the log output of subsequent steps and turns `javac` diagnostics into GitHub [annotations](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) that appear in the run summary and inline on the affected files. It matches two kinds of lines:
|
By default, `setup-java` registers a [problem matcher](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md) for Java after installing the JDK. It scans the log output of subsequent steps and turns Java diagnostics into GitHub [annotations](https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#setting-a-warning-message) that appear in the run summary and inline on the affected files. It matches three kinds of lines:
|
||||||
|
|
||||||
- Compiler errors and warnings, e.g. `App.java:12: error: cannot find symbol` (owner `javac`).
|
- Compiler errors and warnings, e.g. `App.java:12: error: cannot find symbol` (owner `javac`).
|
||||||
|
- Maven compiler errors and warnings, e.g. `[ERROR] /path/App.java:[12,5] cannot find symbol` (owner `maven-javac`).
|
||||||
- Uncaught-exception header lines, e.g. `Exception in thread "main" ...`; because these lines have no file or line captures, they appear as log/run-level annotations rather than inline file annotations (owner `java`).
|
- Uncaught-exception header lines, e.g. `Exception in thread "main" ...`; because these lines have no file or line captures, they appear as log/run-level annotations rather than inline file annotations (owner `java`).
|
||||||
|
|
||||||
This is enabled by default and requires no configuration.
|
GitHub Actions limits problem matcher annotations to 10 of each severity per step and 50 annotations per job. Additional diagnostics remain available in the build log. Log grouping does not change these limits because every matched diagnostic still counts as an annotation.
|
||||||
|
|
||||||
### Disabling the problem matcher
|
### Disabling the problem matcher
|
||||||
|
|
||||||
There is no action input to turn the matcher off, but you can disable it for the rest of the job with the built-in [`remove-matcher`](https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md#remove-a-problem-matcher) workflow command. Pass the matcher **owner** (not a file name); the Java matcher defines two owners, `javac` and `java`, so remove both to fully suppress it:
|
Set `problem-matcher` to `false` to prevent the matcher from being registered:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
@@ -622,24 +801,18 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
|
problem-matcher: false
|
||||||
- name: Disable the Java problem matcher
|
|
||||||
run: |
|
|
||||||
echo "::remove-matcher owner=javac::"
|
|
||||||
echo "::remove-matcher owner=java::"
|
|
||||||
|
|
||||||
- name: Build with Maven
|
- name: Build with Maven
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn package --file pom.xml
|
||||||
```
|
```
|
||||||
|
|
||||||
***NOTES***:
|
Disabling the matcher only stops annotations from being created. Compiler output remains in the log, and compilation errors still fail the build step.
|
||||||
- `remove-matcher` only stops annotations from being created; the underlying compiler output is unchanged, so a failing `javac`/build still fails the step.
|
|
||||||
- The command is scoped to the job, so add the step right after `setup-java` (and before your build) in every job where you want the matcher disabled.
|
|
||||||
|
|
||||||
## Publishing using Gradle
|
## Publishing using Gradle
|
||||||
```yaml
|
```yaml
|
||||||
@@ -649,10 +822,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
|
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK 11
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
@@ -684,16 +857,18 @@ The `setup-java` action generates a basic [Maven Toolchains declaration](https:/
|
|||||||
### Installing Multiple JDKs With Toolchains
|
### Installing Multiple JDKs With Toolchains
|
||||||
Subsequent calls to `setup-java` with distinct distribution and version parameters will continue to extend the toolchains declaration and make all specified Java versions available.
|
Subsequent calls to `setup-java` with distinct distribution and version parameters will continue to extend the toolchains declaration and make all specified Java versions available.
|
||||||
|
|
||||||
|
Toolchain entries are always merged non-destructively: existing JDK, custom, and user-managed toolchains are preserved, and only an entry with the exact same `type` and `provides.id` is replaced. This behavior is independent of the `overwrite-settings` input, which only controls regeneration of `settings.xml`. As a result, running `setup-java` several times in the same job (for example in multiple steps or with multiple `java-version` values) accumulates every JDK in `toolchains.xml` instead of dropping previously registered entries.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: |
|
java-version: |
|
||||||
8
|
8
|
||||||
11
|
11
|
||||||
|
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '15'
|
java-version: '15'
|
||||||
@@ -705,10 +880,10 @@ The result is a Toolchain with entries for JDKs 8, 11 and 15. You can even combi
|
|||||||
- run: |
|
- run: |
|
||||||
download_url="https://example.com/java/jdk/6u45-b06/jdk-6u45-linux-x64.tar.gz"
|
download_url="https://example.com/java/jdk/6u45-b06/jdk-6u45-linux-x64.tar.gz"
|
||||||
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||||
java-version: '1.6'
|
java-version: '1.6'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
```
|
```
|
||||||
@@ -722,10 +897,10 @@ Each JDK provider will receive a default `vendor` using the `distribution` input
|
|||||||
- run: |
|
- run: |
|
||||||
download_url="https://example.com/java/jdk/6u45-b06/jdk-6u45-linux-x64.tar.gz"
|
download_url="https://example.com/java/jdk/6u45-b06/jdk-6u45-linux-x64.tar.gz"
|
||||||
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
jdk-file: ${{ runner.temp }}/java_package.tar.gz
|
||||||
java-version: '1.6'
|
java-version: '1.6'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
mvn-toolchain-vendor: 'Oracle'
|
mvn-toolchain-vendor: 'Oracle'
|
||||||
@@ -737,7 +912,7 @@ In case you install multiple versions of Java at once with multi-line `java-vers
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: |
|
java-version: |
|
||||||
@@ -751,20 +926,20 @@ Each JDK provider will receive a default `id` based on the combination of `distr
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v7
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
mvn-toolchain-id: 'some_other_id'
|
mvn-toolchain-id: 'some_other_id'
|
||||||
- run: java --version
|
- run: java --version
|
||||||
```
|
```
|
||||||
|
|
||||||
In case you install multiple versions of Java at once you can use the same syntax as used in `java-versions`. Please note that you have to declare an ID for all Java versions that will be installed or the `mvn-toolchain-id` instruction will be skipped wholesale due to mapping ambiguities.
|
In case you install multiple versions of Java at once you can use the same syntax as used in `java-versions`. Please note that you have to declare an ID for all Java versions that will be installed or the `mvn-toolchain-id` instruction will be skipped wholesale due to mapping ambiguities.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: |
|
java-version: |
|
||||||
@@ -780,7 +955,27 @@ steps:
|
|||||||
|
|
||||||
Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
|
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 `.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/)).
|
* 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 `.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.
|
* 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:
|
Supported SDKMAN suffix mappings:
|
||||||
@@ -806,7 +1001,7 @@ steps:
|
|||||||
**Example step using `Sdkman!`** (distribution inferred from `.sdkmanrc`):
|
**Example step using `Sdkman!`** (distribution inferred from `.sdkmanrc`):
|
||||||
```yml
|
```yml
|
||||||
- name: Setup java
|
- name: Setup java
|
||||||
uses: actions/setup-java@v5
|
uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
java-version-file: '.sdkmanrc'
|
java-version-file: '.sdkmanrc'
|
||||||
```
|
```
|
||||||
@@ -816,6 +1011,19 @@ steps:
|
|||||||
java=17.0.7-tem
|
java=17.0.7-tem
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Example step using `asdf`** (distribution inferred from `.tool-versions`):
|
||||||
|
```yml
|
||||||
|
- name: Setup java
|
||||||
|
uses: actions/setup-java@v6
|
||||||
|
with:
|
||||||
|
java-version-file: '.tool-versions'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example `.tool-versions`**:
|
||||||
|
```
|
||||||
|
java temurin-17.0.7+7
|
||||||
|
```
|
||||||
|
|
||||||
Valid entry options (does not apply to `.sdkmanrc`):
|
Valid entry options (does not apply to `.sdkmanrc`):
|
||||||
```
|
```
|
||||||
major versions: 8, 11, 16, 17, 21
|
major versions: 8, 11, 16, 17, 21
|
||||||
@@ -850,7 +1058,7 @@ steps:
|
|||||||
- name: Trust the internal CA
|
- name: Trust the internal CA
|
||||||
run: echo "NODE_EXTRA_CA_CERTS=/etc/ssl/certs/internal-ca.pem" >> "$GITHUB_ENV"
|
run: echo "NODE_EXTRA_CA_CERTS=/etc/ssl/certs/internal-ca.pem" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
@@ -865,7 +1073,7 @@ steps:
|
|||||||
echo "${{ secrets.INTERNAL_CA_PEM }}" > "${RUNNER_TEMP}/internal-ca.pem"
|
echo "${{ secrets.INTERNAL_CA_PEM }}" > "${RUNNER_TEMP}/internal-ca.pem"
|
||||||
echo "NODE_EXTRA_CA_CERTS=${RUNNER_TEMP}/internal-ca.pem" >> "$GITHUB_ENV"
|
echo "NODE_EXTRA_CA_CERTS=${RUNNER_TEMP}/internal-ca.pem" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
@@ -893,7 +1101,7 @@ The JDK keeps its own trust store — a keystore named `cacerts` under `$JAVA_HO
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-java@v5
|
- uses: actions/setup-java@v6
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '21'
|
||||||
@@ -918,4 +1126,3 @@ Notes and caveats:
|
|||||||
- Prefer giving the certificate a stable, descriptive `-alias` so re-runs are idempotent (re-importing the same alias will fail; add `keytool -delete -alias internal-ca ...` first if you re-run within a long-lived runner).
|
- Prefer giving the certificate a stable, descriptive `-alias` so re-runs are idempotent (re-importing the same alias will fail; add `keytool -delete -alias internal-ca ...` first if you re-run within a long-lived runner).
|
||||||
|
|
||||||
This documents the post-install workflow; there is no dedicated action input for supplying a custom `cacerts` file.
|
This documents the post-install workflow; there is no dedicated action input for supplying a custom `cacerts` file.
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,13 @@ The major breaking change in V2 is the new mandatory `distribution` input. This
|
|||||||
Use the `zulu` keyword if you would like to continue using the same distribution as in V1.
|
Use the `zulu` keyword if you would like to continue using the same distribution as in V1.
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-java@v2
|
- uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu'
|
distribution: 'zulu'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
java-package: jdk # optional (jdk or jre) - defaults to jdk
|
java-package: jdk # optional (jdk or jre) - defaults to jdk
|
||||||
- run: java -cp java HelloWorldApp
|
- run: java -cp java HelloWorldApp
|
||||||
```
|
```
|
||||||
|
|
||||||
**General recommendation** — configure CI with the same distribution that is used on your local dev machine.
|
**General recommendation** — configure CI with the same distribution that is used on your local dev machine.
|
||||||
@@ -19,10 +19,10 @@ steps:
|
|||||||
Since the `distribution` input is required in V2, you should specify it using `jdkfile` to continue installing Java from a local file on the runner
|
Since the `distribution` input is required in V2, you should specify it using `jdkfile` to continue installing Java from a local file on the runner
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
download_url="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz"
|
download_url="https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz"
|
||||||
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
wget -O $RUNNER_TEMP/java_package.tar.gz $download_url
|
||||||
- uses: actions/setup-java@v2
|
- uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
distribution: 'jdkfile'
|
distribution: 'jdkfile'
|
||||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
// 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
|
||||||
|
];
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
clearMocks: true,
|
|
||||||
moduleFileExtensions: ['js', 'ts'],
|
|
||||||
testEnvironment: 'node',
|
|
||||||
testMatch: ['**/*.test.ts'],
|
|
||||||
testRunner: 'jest-circus/runner',
|
|
||||||
transform: {
|
|
||||||
'^.+\\.ts$': 'ts-jest'
|
|
||||||
},
|
|
||||||
verbose: true
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
Generated
+1739
-1728
File diff suppressed because it is too large
Load Diff
+28
-26
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-java",
|
"name": "setup-java",
|
||||||
"version": "5.3.0",
|
"version": "6.0.0",
|
||||||
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup java action",
|
"description": "setup java action",
|
||||||
"main": "dist/setup/index.js",
|
"main": "dist/setup/index.js",
|
||||||
@@ -9,24 +10,24 @@
|
|||||||
},
|
},
|
||||||
"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 --write \"**/*.{ts,yml,yaml}\"",
|
||||||
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check \"**/*.{ts,yml,yaml}\"",
|
"format-check": "prettier --no-error-on-unmatched-pattern --check \"**/*.{ts,yml,yaml}\"",
|
||||||
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
|
"lint": "eslint \"**/*.ts\"",
|
||||||
"lint:fix": "eslint --config ./.eslintrc.js \"**/*.ts\" --fix",
|
"lint:fix": "eslint \"**/*.ts\" --fix",
|
||||||
"check": "npm run format-check && npm run lint && npm run build && npm test",
|
"check": "npm run format-check && npm run lint && npm run build && npm test",
|
||||||
"fix": "npm run format && npm run lint:fix && npm run build",
|
"fix": "npm run format && npm run lint:fix && npm run build",
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"prerelease": "npm run-script build",
|
"prerelease": "npm run-script build",
|
||||||
"release": "git add -f dist/setup/index.js dist/cleanup/index.js",
|
"release": "git add -f dist/setup/index.js dist/cleanup/index.js",
|
||||||
"test": "jest"
|
"test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand --coverage"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"*.ts": [
|
"*.ts": [
|
||||||
"prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write",
|
"prettier --no-error-on-unmatched-pattern --write",
|
||||||
"eslint --config ./.eslintrc.js --fix"
|
"eslint --fix"
|
||||||
],
|
],
|
||||||
"*.{yml,yaml}": [
|
"*.{yml,yaml}": [
|
||||||
"prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write"
|
"prettier --no-error-on-unmatched-pattern --write"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -41,34 +42,35 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^5.1.0",
|
"@actions/cache": "^6.2.0",
|
||||||
"@actions/core": "^2.0.3",
|
"@actions/core": "^3.0.1",
|
||||||
"@actions/exec": "^2.0.0",
|
"@actions/exec": "^3.0.0",
|
||||||
"@actions/glob": "^0.5.1",
|
"@actions/glob": "^0.7.0",
|
||||||
"@actions/http-client": "^3.0.2",
|
"@actions/http-client": "^4.0.1",
|
||||||
"@actions/io": "^2.0.0",
|
"@actions/io": "^3.0.2",
|
||||||
"@actions/tool-cache": "^3.0.1",
|
"@actions/tool-cache": "^4.0.0",
|
||||||
"semver": "^7.6.0",
|
"semver": "^7.8.5",
|
||||||
"xmlbuilder2": "^4.0.3"
|
"xmlbuilder2": "^4.0.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^30.0.0",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/node": "^26.0.0",
|
"@jest/globals": "^30.4.1",
|
||||||
"@types/semver": "^7.5.8",
|
"@types/node": "^26.1.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
"@types/semver": "^7.7.0",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^8.62.0",
|
||||||
"@typescript-eslint/parser": "^8.62.0",
|
"@typescript-eslint/parser": "^8.62.0",
|
||||||
"@vercel/ncc": "^0.44.0",
|
"@vercel/ncc": "^0.44.0",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^10.7.0",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-plugin-jest": "^29.15.4",
|
"eslint-plugin-jest": "^29.15.4",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-n": "^18.2.2",
|
||||||
|
"globals": "^17.7.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"jest": "^30.4.2",
|
"jest": "^30.4.2",
|
||||||
"jest-circus": "^30.4.2",
|
|
||||||
"lint-staged": "^17.0.8",
|
"lint-staged": "^17.0.8",
|
||||||
"prettier": "^3.9.1",
|
"prettier": "^3.9.5",
|
||||||
"ts-jest": "^29.4.11",
|
"ts-jest": "^29.4.11",
|
||||||
"typescript": "^5.3.3"
|
"typescript": "^6.0.3"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/actions/setup-java/issues"
|
"url": "https://github.com/actions/setup-java/issues"
|
||||||
|
|||||||
+23
-8
@@ -6,9 +6,9 @@ import * as fs from 'fs';
|
|||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
|
|
||||||
import {create as xmlCreate} from 'xmlbuilder2';
|
import {create as xmlCreate} from 'xmlbuilder2';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants.js';
|
||||||
import * as gpg from './gpg';
|
import * as gpg from './gpg.js';
|
||||||
import {getBooleanInput} from './util';
|
import {getBooleanInput} from './util.js';
|
||||||
|
|
||||||
export async function configureAuthentication() {
|
export async function configureAuthentication() {
|
||||||
const id = core.getInput(constants.INPUT_SERVER_ID);
|
const id = core.getInput(constants.INPUT_SERVER_ID);
|
||||||
@@ -93,12 +93,27 @@ export function generate(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (gpgPassphrase) {
|
// The maven-gpg-plugin reads the passphrase from the environment variable
|
||||||
const gpgServer = {
|
// named by the `gpg.passphraseEnvName` property (default MAVEN_GPG_PASSPHRASE).
|
||||||
id: 'gpg.passphrase',
|
// Only configure it when the requested env var name differs from that default;
|
||||||
passphrase: `\${env.${gpgPassphrase}}`
|
// otherwise the plugin already reads the right variable and no extra settings
|
||||||
|
// are needed. Writing `gpg.passphrase` to settings.xml is deprecated and fails
|
||||||
|
// when the plugin's `bestPractices` mode is enabled.
|
||||||
|
if (
|
||||||
|
gpgPassphrase &&
|
||||||
|
gpgPassphrase !== constants.MAVEN_GPG_PASSPHRASE_DEFAULT_ENV
|
||||||
|
) {
|
||||||
|
xmlObj.settings.profiles = {
|
||||||
|
profile: {
|
||||||
|
id: constants.GPG_PASSPHRASE_PROFILE_ID,
|
||||||
|
properties: {
|
||||||
|
'gpg.passphraseEnvName': gpgPassphrase
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
xmlObj.settings.activeProfiles = {
|
||||||
|
activeProfile: constants.GPG_PASSPHRASE_PROFILE_ID
|
||||||
};
|
};
|
||||||
xmlObj.settings.servers.server.push(gpgServer);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return xmlCreate(xmlObj).end({
|
return xmlCreate(xmlObj).end({
|
||||||
|
|||||||
+191
-10
@@ -12,6 +12,30 @@ const STATE_CACHE_PRIMARY_KEY = 'cache-primary-key';
|
|||||||
const CACHE_MATCHED_KEY = 'cache-matched-key';
|
const CACHE_MATCHED_KEY = 'cache-matched-key';
|
||||||
const CACHE_KEY_PREFIX = 'setup-java';
|
const CACHE_KEY_PREFIX = 'setup-java';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An additional cache entry that is restored and saved independently of the
|
||||||
|
* main dependency cache. Used for build-tool wrapper distributions that rarely
|
||||||
|
* change (e.g. the Maven wrapper distribution) so that they are not evicted
|
||||||
|
* every time a volatile dependency file such as pom.xml changes. See
|
||||||
|
* https://github.com/actions/setup-java/issues/1095.
|
||||||
|
*/
|
||||||
|
interface AdditionalCache {
|
||||||
|
/**
|
||||||
|
* Short identifier for the cache, used to build its cache key and to scope
|
||||||
|
* the state keys that carry information from restore to save.
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* Paths that make up this cache entry.
|
||||||
|
*/
|
||||||
|
path: string[];
|
||||||
|
/**
|
||||||
|
* Glob patterns whose hash forms the cache key. If no file matches, the
|
||||||
|
* cache is skipped silently (the project simply does not use this feature).
|
||||||
|
*/
|
||||||
|
pattern: string[];
|
||||||
|
}
|
||||||
|
|
||||||
interface PackageManager {
|
interface PackageManager {
|
||||||
id: 'maven' | 'gradle' | 'sbt';
|
id: 'maven' | 'gradle' | 'sbt';
|
||||||
/**
|
/**
|
||||||
@@ -19,23 +43,36 @@ interface PackageManager {
|
|||||||
*/
|
*/
|
||||||
path: string[];
|
path: string[];
|
||||||
pattern: string[];
|
pattern: string[];
|
||||||
|
/**
|
||||||
|
* Additional caches keyed independently of the main dependency cache.
|
||||||
|
*/
|
||||||
|
additionalCaches?: AdditionalCache[];
|
||||||
}
|
}
|
||||||
const supportedPackageManager: PackageManager[] = [
|
const supportedPackageManager: PackageManager[] = [
|
||||||
{
|
{
|
||||||
id: 'maven',
|
id: 'maven',
|
||||||
path: [
|
path: [join(os.homedir(), '.m2', 'repository')],
|
||||||
join(os.homedir(), '.m2', 'repository'),
|
|
||||||
join(os.homedir(), '.m2', 'wrapper', 'dists')
|
|
||||||
],
|
|
||||||
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
|
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---maven
|
||||||
pattern: ['**/pom.xml', '**/.mvn/wrapper/maven-wrapper.properties']
|
pattern: [
|
||||||
|
'**/pom.xml',
|
||||||
|
'**/.mvn/wrapper/maven-wrapper.properties',
|
||||||
|
'**/.mvn/extensions.xml'
|
||||||
|
],
|
||||||
|
// The Maven wrapper distribution only depends on the wrapper properties,
|
||||||
|
// which change very rarely, so it is cached separately from the local
|
||||||
|
// repository. This keeps it available across the frequent pom.xml changes
|
||||||
|
// that rotate the main cache key. See issue #1095.
|
||||||
|
additionalCaches: [
|
||||||
|
{
|
||||||
|
name: 'maven-wrapper',
|
||||||
|
path: [join(os.homedir(), '.m2', 'wrapper', 'dists')],
|
||||||
|
pattern: ['**/.mvn/wrapper/maven-wrapper.properties']
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'gradle',
|
id: 'gradle',
|
||||||
path: [
|
path: [join(os.homedir(), '.gradle', 'caches')],
|
||||||
join(os.homedir(), '.gradle', 'caches'),
|
|
||||||
join(os.homedir(), '.gradle', 'wrapper')
|
|
||||||
],
|
|
||||||
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
|
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
|
||||||
pattern: [
|
pattern: [
|
||||||
'**/*.gradle*',
|
'**/*.gradle*',
|
||||||
@@ -44,6 +81,17 @@ const supportedPackageManager: PackageManager[] = [
|
|||||||
'buildSrc/**/Dependencies.kt',
|
'buildSrc/**/Dependencies.kt',
|
||||||
'gradle/*.versions.toml',
|
'gradle/*.versions.toml',
|
||||||
'**/versions.properties'
|
'**/versions.properties'
|
||||||
|
],
|
||||||
|
// The Gradle wrapper distribution only depends on the wrapper properties,
|
||||||
|
// which change very rarely, so it is cached separately from the Gradle
|
||||||
|
// caches. This keeps it available across the frequent *.gradle* changes
|
||||||
|
// that rotate the main cache key. See issue #269.
|
||||||
|
additionalCaches: [
|
||||||
|
{
|
||||||
|
name: 'gradle-wrapper',
|
||||||
|
path: [join(os.homedir(), '.gradle', 'wrapper')],
|
||||||
|
pattern: ['**/gradle-wrapper.properties']
|
||||||
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -83,6 +131,21 @@ function findPackageManager(id: string): PackageManager {
|
|||||||
return packageManager;
|
return packageManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* State keys used to carry an additional cache's restore-time information over
|
||||||
|
* to the post (save) action, scoped by the additional cache name.
|
||||||
|
*/
|
||||||
|
function additionalCachePrimaryKeyState(name: string): string {
|
||||||
|
return `${STATE_CACHE_PRIMARY_KEY}-${name}`;
|
||||||
|
}
|
||||||
|
function additionalCacheMatchedKeyState(name: string): string {
|
||||||
|
return `${CACHE_MATCHED_KEY}-${name}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildCacheKey(id: string, fileHash: string): string {
|
||||||
|
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-${id}-${fileHash}`;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A function that generates a cache key to use.
|
* A function that generates a cache key to use.
|
||||||
* Format of the generated key will be "${{ platform }}-${{ id }}-${{ fileHash }}"".
|
* Format of the generated key will be "${{ platform }}-${{ id }}-${{ fileHash }}"".
|
||||||
@@ -101,7 +164,22 @@ async function computeCacheKey(
|
|||||||
`No file in ${process.cwd()} matched to [${pattern}], make sure you have checked out the target repository`
|
`No file in ${process.cwd()} matched to [${pattern}], make sure you have checked out the target repository`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-${packageManager.id}-${fileHash}`;
|
return buildCacheKey(packageManager.id, fileHash);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Computes the cache key for an additional cache. Unlike {@link computeCacheKey}
|
||||||
|
* this returns undefined (instead of throwing) when no file matches the pattern,
|
||||||
|
* because additional caches are optional features that many projects do not use.
|
||||||
|
*/
|
||||||
|
async function computeAdditionalCacheKey(
|
||||||
|
additionalCache: AdditionalCache
|
||||||
|
): Promise<string | undefined> {
|
||||||
|
const fileHash = await glob.hashFiles(additionalCache.pattern.join('\n'));
|
||||||
|
if (!fileHash) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
return buildCacheKey(additionalCache.name, fileHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -114,6 +192,7 @@ export async function restore(id: string, cacheDependencyPath: string) {
|
|||||||
const primaryKey = await computeCacheKey(packageManager, cacheDependencyPath);
|
const primaryKey = await computeCacheKey(packageManager, cacheDependencyPath);
|
||||||
core.debug(`primary key is ${primaryKey}`);
|
core.debug(`primary key is ${primaryKey}`);
|
||||||
core.saveState(STATE_CACHE_PRIMARY_KEY, primaryKey);
|
core.saveState(STATE_CACHE_PRIMARY_KEY, primaryKey);
|
||||||
|
core.setOutput(STATE_CACHE_PRIMARY_KEY, primaryKey);
|
||||||
|
|
||||||
// No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269)
|
// No "restoreKeys" is set, to start with a clear cache after dependency update (see https://github.com/actions/setup-java/issues/269)
|
||||||
const matchedKey = await cache.restoreCache(packageManager.path, primaryKey);
|
const matchedKey = await cache.restoreCache(packageManager.path, primaryKey);
|
||||||
@@ -125,6 +204,40 @@ export async function restore(id: string, cacheDependencyPath: string) {
|
|||||||
core.setOutput('cache-hit', false);
|
core.setOutput('cache-hit', false);
|
||||||
core.info(`${packageManager.id} cache is not found`);
|
core.info(`${packageManager.id} cache is not found`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const additionalCache of packageManager.additionalCaches ?? []) {
|
||||||
|
await restoreAdditionalCache(additionalCache);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Restore an additional cache (e.g. a build-tool wrapper distribution) that is
|
||||||
|
* keyed independently of the main dependency cache so that it survives changes
|
||||||
|
* to volatile dependency files. Skips silently when the project does not use
|
||||||
|
* the corresponding feature.
|
||||||
|
*/
|
||||||
|
async function restoreAdditionalCache(additionalCache: AdditionalCache) {
|
||||||
|
const primaryKey = await computeAdditionalCacheKey(additionalCache);
|
||||||
|
if (!primaryKey) {
|
||||||
|
core.debug(
|
||||||
|
`No file matched [${additionalCache.pattern}] for the ${additionalCache.name} cache, skipping.`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
core.debug(`${additionalCache.name} primary key is ${primaryKey}`);
|
||||||
|
core.saveState(
|
||||||
|
additionalCachePrimaryKeyState(additionalCache.name),
|
||||||
|
primaryKey
|
||||||
|
);
|
||||||
|
|
||||||
|
const matchedKey = await cache.restoreCache(additionalCache.path, primaryKey);
|
||||||
|
if (matchedKey) {
|
||||||
|
core.saveState(
|
||||||
|
additionalCacheMatchedKeyState(additionalCache.name),
|
||||||
|
matchedKey
|
||||||
|
);
|
||||||
|
core.info(`${additionalCache.name} cache restored from key: ${matchedKey}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -138,6 +251,10 @@ export async function save(id: string) {
|
|||||||
// Inputs are re-evaluated before the post action, so we want the original key used for restore
|
// Inputs are re-evaluated before the post action, so we want the original key used for restore
|
||||||
const primaryKey = core.getState(STATE_CACHE_PRIMARY_KEY);
|
const primaryKey = core.getState(STATE_CACHE_PRIMARY_KEY);
|
||||||
|
|
||||||
|
for (const additionalCache of packageManager.additionalCaches ?? []) {
|
||||||
|
await saveAdditionalCache(packageManager, additionalCache);
|
||||||
|
}
|
||||||
|
|
||||||
if (!primaryKey) {
|
if (!primaryKey) {
|
||||||
core.warning('Error retrieving key from state.');
|
core.warning('Error retrieving key from state.');
|
||||||
return;
|
return;
|
||||||
@@ -175,6 +292,70 @@ export async function save(id: string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save an additional cache under its own key. Skips when no key was recorded at
|
||||||
|
* restore time (feature unused) or when the exact key was already restored.
|
||||||
|
*/
|
||||||
|
async function saveAdditionalCache(
|
||||||
|
packageManager: PackageManager,
|
||||||
|
additionalCache: AdditionalCache
|
||||||
|
) {
|
||||||
|
const primaryKey = core.getState(
|
||||||
|
additionalCachePrimaryKeyState(additionalCache.name)
|
||||||
|
);
|
||||||
|
const matchedKey = core.getState(
|
||||||
|
additionalCacheMatchedKeyState(additionalCache.name)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!primaryKey) {
|
||||||
|
// The feature is not used by this project, nothing to save.
|
||||||
|
core.debug(
|
||||||
|
`No primary key for the ${additionalCache.name} cache, not saving cache.`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
} else if (matchedKey === primaryKey) {
|
||||||
|
core.info(
|
||||||
|
`Cache hit occurred on the ${additionalCache.name} primary key ${primaryKey}, not saving cache.`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const cacheId = await cache.saveCache(additionalCache.path, primaryKey);
|
||||||
|
if (cacheId === -1) {
|
||||||
|
core.debug(
|
||||||
|
`${additionalCache.name} cache was not saved for the key: ${primaryKey}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
core.info(
|
||||||
|
`${additionalCache.name} cache saved with the key: ${primaryKey}`
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
const err = error as Error;
|
||||||
|
|
||||||
|
if (err.name === cache.ValidationError.name) {
|
||||||
|
// The cache paths did not resolve, e.g. the wrapper distribution was
|
||||||
|
// never downloaded because a system build tool was used or the download
|
||||||
|
// failed. Optional wrapper caches must not fail the post step, so skip.
|
||||||
|
core.debug(
|
||||||
|
`${additionalCache.name} cache paths do not exist, not saving cache: ${err.message}`
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err.name === cache.ReserveCacheError.name) {
|
||||||
|
core.info(err.message);
|
||||||
|
} else {
|
||||||
|
if (isProbablyGradleDaemonProblem(packageManager, err)) {
|
||||||
|
core.warning(
|
||||||
|
'Failed to save Gradle cache on Windows. If tar.exe reported "Permission denied", try to run Gradle with `--no-daemon` option. Refer to https://github.com/actions/cache/issues/454 for details.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param packageManager the specified package manager by user
|
* @param packageManager the specified package manager by user
|
||||||
* @param error the error thrown by the saveCache
|
* @param error the error thrown by the saveCache
|
||||||
|
|||||||
+6
-5
@@ -1,8 +1,9 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as gpg from './gpg';
|
import * as gpg from './gpg.js';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants.js';
|
||||||
import {isJobStatusSuccess} from './util';
|
import {isJobStatusSuccess} from './util.js';
|
||||||
import {save} from './cache';
|
import {save} from './cache.js';
|
||||||
|
import {fileURLToPath} from 'url';
|
||||||
|
|
||||||
async function removePrivateKeyFromKeychain() {
|
async function removePrivateKeyFromKeychain() {
|
||||||
if (core.getInput(constants.INPUT_GPG_PRIVATE_KEY, {required: false})) {
|
if (core.getInput(constants.INPUT_GPG_PRIVATE_KEY, {required: false})) {
|
||||||
@@ -52,7 +53,7 @@ export async function run() {
|
|||||||
await ignoreError(saveCache());
|
await ignoreError(saveCache());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (require.main === module) {
|
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
||||||
run();
|
run();
|
||||||
} else {
|
} else {
|
||||||
// https://nodejs.org/api/modules.html#modules_accessing_the_main_module
|
// https://nodejs.org/api/modules.html#modules_accessing_the_main_module
|
||||||
|
|||||||
+11
-1
@@ -4,9 +4,11 @@ export const INPUT_JAVA_VERSION_FILE = 'java-version-file';
|
|||||||
export const INPUT_ARCHITECTURE = 'architecture';
|
export const INPUT_ARCHITECTURE = 'architecture';
|
||||||
export const INPUT_JAVA_PACKAGE = 'java-package';
|
export const INPUT_JAVA_PACKAGE = 'java-package';
|
||||||
export const INPUT_DISTRIBUTION = 'distribution';
|
export const INPUT_DISTRIBUTION = 'distribution';
|
||||||
export const INPUT_JDK_FILE = 'jdkFile';
|
export const INPUT_JDK_FILE = 'jdk-file';
|
||||||
|
export const INPUT_JDK_FILE_DEPRECATED = 'jdkFile';
|
||||||
export const INPUT_CHECK_LATEST = 'check-latest';
|
export const INPUT_CHECK_LATEST = 'check-latest';
|
||||||
export const INPUT_SET_DEFAULT = 'set-default';
|
export const INPUT_SET_DEFAULT = 'set-default';
|
||||||
|
export const INPUT_PROBLEM_MATCHER = 'problem-matcher';
|
||||||
export const INPUT_VERIFY_SIGNATURE = 'verify-signature';
|
export const INPUT_VERIFY_SIGNATURE = 'verify-signature';
|
||||||
export const INPUT_VERIFY_SIGNATURE_PUBLIC_KEY = 'verify-signature-public-key';
|
export const INPUT_VERIFY_SIGNATURE_PUBLIC_KEY = 'verify-signature-public-key';
|
||||||
export const INPUT_SERVER_ID = 'server-id';
|
export const INPUT_SERVER_ID = 'server-id';
|
||||||
@@ -20,6 +22,14 @@ export const INPUT_GPG_PASSPHRASE = 'gpg-passphrase';
|
|||||||
export const INPUT_DEFAULT_GPG_PRIVATE_KEY = undefined;
|
export const INPUT_DEFAULT_GPG_PRIVATE_KEY = undefined;
|
||||||
export const INPUT_DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE';
|
export const INPUT_DEFAULT_GPG_PASSPHRASE = 'GPG_PASSPHRASE';
|
||||||
|
|
||||||
|
// The default name of the environment variable the maven-gpg-plugin reads the
|
||||||
|
// passphrase from (property `gpg.passphraseEnvName`). When the configured
|
||||||
|
// passphrase env var name matches this, no extra configuration is required.
|
||||||
|
export const MAVEN_GPG_PASSPHRASE_DEFAULT_ENV = 'MAVEN_GPG_PASSPHRASE';
|
||||||
|
|
||||||
|
// Id of the settings.xml profile used to set `gpg.passphraseEnvName`.
|
||||||
|
export const GPG_PASSPHRASE_PROFILE_ID = 'setup-java-gpg';
|
||||||
|
|
||||||
export const INPUT_CACHE = 'cache';
|
export const INPUT_CACHE = 'cache';
|
||||||
export const INPUT_CACHE_DEPENDENCY_PATH = 'cache-dependency-path';
|
export const INPUT_CACHE_DEPENDENCY_PATH = 'cache-dependency-path';
|
||||||
export const INPUT_JOB_STATUS = 'job-status';
|
export const INPUT_JOB_STATUS = 'job-status';
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ import fs from 'fs';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
import {JavaBase} from '../base-installer.js';
|
||||||
import {IAdoptAvailableVersions} from './models';
|
import {IAdoptAvailableVersions} from './models.js';
|
||||||
import {
|
import {
|
||||||
JavaDownloadRelease,
|
JavaDownloadRelease,
|
||||||
JavaInstallerOptions,
|
JavaInstallerOptions,
|
||||||
JavaInstallerResults
|
JavaInstallerResults
|
||||||
} from '../base-models';
|
} from '../base-models.js';
|
||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getNextPageUrlFromLinkHeader,
|
getNextPageUrlFromLinkHeader,
|
||||||
@@ -20,8 +20,11 @@ import {
|
|||||||
renameWinArchive,
|
renameWinArchive,
|
||||||
MAX_PAGINATION_PAGES,
|
MAX_PAGINATION_PAGES,
|
||||||
validatePaginationUrl
|
validatePaginationUrl
|
||||||
} from '../../util';
|
} from '../../util.js';
|
||||||
import {TemurinDistribution, TemurinImplementation} from '../temurin/installer';
|
import {
|
||||||
|
TemurinDistribution,
|
||||||
|
TemurinImplementation
|
||||||
|
} from '../temurin/installer.js';
|
||||||
|
|
||||||
export enum AdoptImplementation {
|
export enum AdoptImplementation {
|
||||||
Hotspot = 'Hotspot',
|
Hotspot = 'Hotspot',
|
||||||
|
|||||||
@@ -4,13 +4,17 @@ import * as fs from 'fs';
|
|||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import * as httpm from '@actions/http-client';
|
import * as httpm from '@actions/http-client';
|
||||||
import {getToolcachePath, isVersionSatisfies} from '../util';
|
import {
|
||||||
|
convertVersionToSemver,
|
||||||
|
getToolcachePath,
|
||||||
|
isVersionSatisfies
|
||||||
|
} from '../util.js';
|
||||||
import {
|
import {
|
||||||
JavaDownloadRelease,
|
JavaDownloadRelease,
|
||||||
JavaInstallerOptions,
|
JavaInstallerOptions,
|
||||||
JavaInstallerResults
|
JavaInstallerResults
|
||||||
} from './base-models';
|
} from './base-models.js';
|
||||||
import {MACOS_JAVA_CONTENT_POSTFIX} from '../constants';
|
import {MACOS_JAVA_CONTENT_POSTFIX} from '../constants.js';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
export abstract class JavaBase {
|
export abstract class JavaBase {
|
||||||
@@ -19,6 +23,7 @@ export abstract class JavaBase {
|
|||||||
protected architecture: string;
|
protected architecture: string;
|
||||||
protected packageType: string;
|
protected packageType: string;
|
||||||
protected stable: boolean;
|
protected stable: boolean;
|
||||||
|
protected latest: boolean;
|
||||||
protected checkLatest: boolean;
|
protected checkLatest: boolean;
|
||||||
protected setDefault: boolean;
|
protected setDefault: boolean;
|
||||||
protected verifySignature: boolean;
|
protected verifySignature: boolean;
|
||||||
@@ -33,9 +38,11 @@ export abstract class JavaBase {
|
|||||||
maxRetries: 3
|
maxRetries: 3
|
||||||
});
|
});
|
||||||
|
|
||||||
({version: this.version, stable: this.stable} = this.normalizeVersion(
|
({
|
||||||
installerOptions.version
|
version: this.version,
|
||||||
));
|
stable: this.stable,
|
||||||
|
latest: this.latest
|
||||||
|
} = this.normalizeVersion(installerOptions.version));
|
||||||
this.architecture = installerOptions.architecture || os.arch();
|
this.architecture = installerOptions.architecture || os.arch();
|
||||||
this.packageType = installerOptions.packageType;
|
this.packageType = installerOptions.packageType;
|
||||||
this.checkLatest = installerOptions.checkLatest;
|
this.checkLatest = installerOptions.checkLatest;
|
||||||
@@ -62,7 +69,7 @@ export abstract class JavaBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let foundJava = this.findInToolcache();
|
let foundJava = this.findInToolcache();
|
||||||
if (foundJava && !this.checkLatest) {
|
if (foundJava && !this.checkLatest && !this.latest) {
|
||||||
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
||||||
} else {
|
} else {
|
||||||
core.info('Trying to resolve the latest version from remote');
|
core.info('Trying to resolve the latest version from remote');
|
||||||
@@ -263,6 +270,30 @@ export abstract class JavaBase {
|
|||||||
|
|
||||||
protected normalizeVersion(version: string) {
|
protected normalizeVersion(version: string) {
|
||||||
let stable = true;
|
let stable = true;
|
||||||
|
const latest = false;
|
||||||
|
|
||||||
|
// Support the `latest` alias (case-insensitive), which floats to the newest
|
||||||
|
// available stable/GA release. It is translated to the SemVer wildcard `x`
|
||||||
|
// so the existing "newest satisfying version wins" resolution applies.
|
||||||
|
const normalized = version.trim().toLowerCase();
|
||||||
|
if (normalized === 'latest') {
|
||||||
|
return {
|
||||||
|
version: 'x',
|
||||||
|
stable: true,
|
||||||
|
latest: true
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Reject `latest` combined with any qualifier (e.g. `latest-ea`). Such inputs
|
||||||
|
// would otherwise have their `-ea` suffix stripped and fall through to the
|
||||||
|
// generic SemVer check, which fails with a confusing "'latest' is not valid
|
||||||
|
// SemVer" message even though `latest` is a supported value. Fail early with a
|
||||||
|
// targeted explanation instead.
|
||||||
|
if (normalized.startsWith('latest')) {
|
||||||
|
throw new Error(
|
||||||
|
`The 'latest' alias resolves stable (GA) releases only and cannot be combined with '-ea' or other qualifiers (received '${version}'). Use 'latest' on its own, or specify a concrete version.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (version.endsWith('-ea')) {
|
if (version.endsWith('-ea')) {
|
||||||
version = version.replace(/-ea$/, '');
|
version = version.replace(/-ea$/, '');
|
||||||
@@ -273,6 +304,15 @@ export abstract class JavaBase {
|
|||||||
stable = false;
|
stable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Java uses a versioning scheme (JEP 322) that can contain more numeric
|
||||||
|
// fields than SemVer allows, e.g. '18.0.1.1' or '11.0.9.1'. Convert such
|
||||||
|
// exact versions to SemVer build notation ('18.0.1+1') so they are
|
||||||
|
// accepted. Ranges and versions that already carry build metadata are
|
||||||
|
// left untouched.
|
||||||
|
if (/^\d+(\.\d+){3,}$/.test(version)) {
|
||||||
|
version = convertVersionToSemver(version);
|
||||||
|
}
|
||||||
|
|
||||||
if (!semver.validRange(version)) {
|
if (!semver.validRange(version)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
|
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
|
||||||
@@ -281,7 +321,8 @@ export abstract class JavaBase {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
version,
|
version,
|
||||||
stable
|
stable,
|
||||||
|
latest
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,17 +7,17 @@ import {
|
|||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
convertVersionToSemver,
|
convertVersionToSemver,
|
||||||
renameWinArchive
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util.js';
|
||||||
import {JavaBase} from '../base-installer';
|
import {JavaBase} from '../base-installer.js';
|
||||||
import {
|
import {
|
||||||
JavaDownloadRelease,
|
JavaDownloadRelease,
|
||||||
JavaInstallerOptions,
|
JavaInstallerOptions,
|
||||||
JavaInstallerResults
|
JavaInstallerResults
|
||||||
} from '../base-models';
|
} from '../base-models.js';
|
||||||
import {
|
import {
|
||||||
ICorrettoAllAvailableVersions,
|
ICorrettoAllAvailableVersions,
|
||||||
ICorrettoAvailableVersions
|
ICorrettoAvailableVersions
|
||||||
} from './models';
|
} from './models.js';
|
||||||
|
|
||||||
export class CorrettoDistribution extends JavaBase {
|
export class CorrettoDistribution extends JavaBase {
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
constructor(installerOptions: JavaInstallerOptions) {
|
||||||
@@ -59,10 +59,28 @@ export class CorrettoDistribution extends JavaBase {
|
|||||||
if (!this.stable) {
|
if (!this.stable) {
|
||||||
throw new Error('Early access versions are not supported');
|
throw new Error('Early access versions are not supported');
|
||||||
}
|
}
|
||||||
|
const availableVersions = await this.getAvailableVersions();
|
||||||
|
|
||||||
|
// The `latest` alias is normalized to the SemVer wildcard, but Corretto
|
||||||
|
// matches on an exact major version, so resolve it to the newest available
|
||||||
|
// major from Corretto's own list.
|
||||||
|
if (this.latest) {
|
||||||
|
const majors = availableVersions
|
||||||
|
.map(item => parseInt(item.version, 10))
|
||||||
|
.filter(major => Number.isFinite(major) && major > 0);
|
||||||
|
|
||||||
|
if (majors.length === 0) {
|
||||||
|
throw new Error(
|
||||||
|
'Could not determine the latest available Corretto major version from remote metadata'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
version = Math.max(...majors).toString();
|
||||||
|
}
|
||||||
|
|
||||||
if (version.includes('.')) {
|
if (version.includes('.')) {
|
||||||
throw new Error('Only major versions are supported');
|
throw new Error('Only major versions are supported');
|
||||||
}
|
}
|
||||||
const availableVersions = await this.getAvailableVersions();
|
|
||||||
const matchingVersions = availableVersions
|
const matchingVersions = availableVersions
|
||||||
.filter(item => item.version == version)
|
.filter(item => item.version == version)
|
||||||
.map(item => {
|
.map(item => {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user