mirror of
https://github.com/actions/setup-java.git
synced 2025-07-04 10:40:54 +00:00
Compare commits
No commits in common. "main" and "v3.10.0" have entirely different histories.
@ -1,6 +0,0 @@
|
|||||||
# Ignore list
|
|
||||||
/*
|
|
||||||
|
|
||||||
# Do not ignore these folders:
|
|
||||||
!__tests__/
|
|
||||||
!src/
|
|
51
.eslintrc.js
51
.eslintrc.js
@ -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
|
|
||||||
}
|
|
||||||
};
|
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,4 +1,3 @@
|
|||||||
* text=auto eol=lf
|
|
||||||
dist/index.js -diff -merge
|
dist/index.js -diff -merge
|
||||||
dist/index.js linguist-generated=true
|
dist/index.js linguist-generated=true
|
||||||
.licenses/** -diff linguist-generated=true
|
.licenses/** -diff linguist-generated=true
|
||||||
|
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -1 +1 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
22
.github/dependabot.yml
vendored
22
.github/dependabot.yml
vendored
@ -1,22 +0,0 @@
|
|||||||
# To get started with Dependabot version updates, you'll need to specify which
|
|
||||||
# package ecosystems to update and where the package manifests are located.
|
|
||||||
# Please see the documentation for all configuration options:
|
|
||||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
# Enable version updates for npm
|
|
||||||
- package-ecosystem: 'npm'
|
|
||||||
# Look for `package.json` and `lock` files in the `root` directory
|
|
||||||
directory: '/'
|
|
||||||
# Check the npm registry for updates every day (weekdays)
|
|
||||||
schedule:
|
|
||||||
interval: 'weekly'
|
|
||||||
|
|
||||||
# Enable version updates for GitHub Actions
|
|
||||||
- package-ecosystem: 'github-actions'
|
|
||||||
# Workflow files stored in the default location of `.github/workflows`
|
|
||||||
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
|
|
||||||
directory: '/'
|
|
||||||
schedule:
|
|
||||||
interval: 'weekly'
|
|
4
.github/workflows/basic-validation.yml
vendored
4
.github/workflows/basic-validation.yml
vendored
@ -14,6 +14,4 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
call-basic-validation:
|
call-basic-validation:
|
||||||
name: Basic validation
|
name: Basic validation
|
||||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
||||||
with:
|
|
||||||
node-version: '20.x'
|
|
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
@ -15,5 +15,3 @@ jobs:
|
|||||||
call-check-dist:
|
call-check-dist:
|
||||||
name: Check dist/
|
name: Check dist/
|
||||||
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
|
||||||
with:
|
|
||||||
node-version: '20.x'
|
|
||||||
|
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
@ -2,13 +2,13 @@ name: CodeQL analysis
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [ main ]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 3 * * 0'
|
- cron: '0 3 * * 0'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
call-codeQL-analysis:
|
call-codeQL-analysis:
|
||||||
name: CodeQL analysis
|
name: CodeQL analysis
|
||||||
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
|
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
|
93
.github/workflows/e2e-cache-dependency-path.yml
vendored
93
.github/workflows/e2e-cache-dependency-path.yml
vendored
@ -1,93 +0,0 @@
|
|||||||
name: Validate cache with cache-dependency-path option
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- releases/*
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
|
|
||||||
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@v4
|
|
||||||
- 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: 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@v4
|
|
||||||
- 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@v4
|
|
||||||
- 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
|
|
41
.github/workflows/e2e-cache.yml
vendored
41
.github/workflows/e2e-cache.yml
vendored
@ -21,10 +21,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Run setup-java with the cache for gradle
|
- name: Run setup-java with the cache for gradle
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -36,7 +36,7 @@ jobs:
|
|||||||
# Need to avoid using Gradle daemon to stabilize the save process on Windows
|
# Need to avoid using Gradle daemon to stabilize the save process on Windows
|
||||||
# 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/gradle
|
||||||
if [ ! -d ~/.gradle/caches ]; then
|
if [ ! -d ~/.gradle/caches ]; then
|
||||||
echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
|
echo "::error::The ~/.gradle/caches directory does not exist unexpectedly"
|
||||||
exit 1
|
exit 1
|
||||||
@ -46,11 +46,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
needs: gradle-save
|
needs: gradle-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Run setup-java with the cache for gradle
|
- name: Run setup-java with the cache for gradle
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -70,10 +70,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Run setup-java with the cache for maven
|
- name: Run setup-java with the cache for maven
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -93,11 +93,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
needs: maven-save
|
needs: maven-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Run setup-java with the cache for maven
|
- name: Run setup-java with the cache for maven
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -121,10 +121,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-22.04]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Run setup-java with the cache for sbt
|
- name: Run setup-java with the cache for sbt
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -132,21 +132,17 @@ jobs:
|
|||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
cache: sbt
|
cache: sbt
|
||||||
- name: Setup SBT
|
|
||||||
if: matrix.os == 'macos-13'
|
|
||||||
run: |
|
|
||||||
echo ""Installing SBT...""
|
|
||||||
brew install sbt
|
|
||||||
- name: Create files to cache
|
- name: Create files to cache
|
||||||
run: sbt update
|
run: sbt update
|
||||||
|
|
||||||
- name: Check files to cache on macos-latest
|
- name: Check files to cache on macos-latest
|
||||||
if: matrix.os == 'macos-13'
|
if: matrix.os == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d ~/Library/Caches/Coursier ]; then
|
if [ ! -d ~/Library/Caches/Coursier ]; then
|
||||||
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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: |
|
||||||
@ -154,6 +150,8 @@ jobs:
|
|||||||
echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly"
|
echo "::error::The ~/AppData/Local/Coursier/Cache directory does not exist unexpectedly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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-latest'
|
||||||
run: |
|
run: |
|
||||||
@ -161,6 +159,7 @@ jobs:
|
|||||||
echo "::error::The ~/.cache/coursier directory does not exist unexpectedly"
|
echo "::error::The ~/.cache/coursier directory does not exist unexpectedly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sbt-restore:
|
sbt-restore:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
defaults:
|
defaults:
|
||||||
@ -170,11 +169,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-22.04]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
needs: sbt-save
|
needs: sbt-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Run setup-java with the cache for sbt
|
- name: Run setup-java with the cache for sbt
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -184,13 +183,14 @@ jobs:
|
|||||||
cache: sbt
|
cache: sbt
|
||||||
|
|
||||||
- name: Confirm that ~/Library/Caches/Coursier directory has been made
|
- name: Confirm that ~/Library/Caches/Coursier directory has been made
|
||||||
if: matrix.os == 'macos-13'
|
if: matrix.os == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d ~/Library/Caches/Coursier ]; then
|
if [ ! -d ~/Library/Caches/Coursier ]; then
|
||||||
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
ls ~/Library/Caches/Coursier
|
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: |
|
||||||
@ -199,6 +199,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
ls ~/AppData/Local/Coursier/Cache
|
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-latest'
|
||||||
run: |
|
run: |
|
||||||
|
6
.github/workflows/e2e-local-file.yml
vendored
6
.github/workflows/e2e-local-file.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Download Adopt OpenJDK file
|
- name: Download Adopt OpenJDK file
|
||||||
run: |
|
run: |
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
@ -58,7 +58,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Download Zulu OpenJDK file
|
- name: Download Zulu OpenJDK file
|
||||||
run: |
|
run: |
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
@ -95,7 +95,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Download Eclipse Temurin file
|
- name: Download Eclipse Temurin file
|
||||||
run: |
|
run: |
|
||||||
if ($IsLinux) {
|
if ($IsLinux) {
|
||||||
|
12
.github/workflows/e2e-publishing.yml
vendored
12
.github/workflows/e2e-publishing.yml
vendored
@ -25,7 +25,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -60,7 +60,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Create fake settings.xml
|
- name: Create fake settings.xml
|
||||||
run: |
|
run: |
|
||||||
$xmlDirectory = Join-Path $HOME ".m2"
|
$xmlDirectory = Join-Path $HOME ".m2"
|
||||||
@ -86,7 +86,7 @@ jobs:
|
|||||||
if ($content -notlike '*maven*') {
|
if ($content -notlike '*maven*') {
|
||||||
throw "settings.xml file is not overwritten"
|
throw "settings.xml file is not overwritten"
|
||||||
}
|
}
|
||||||
|
|
||||||
test-publishing-skip-overwrite:
|
test-publishing-skip-overwrite:
|
||||||
name: settings.xml is not overwritten if flag is false
|
name: settings.xml is not overwritten if flag is false
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -96,7 +96,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Create fake settings.xml
|
- name: Create fake settings.xml
|
||||||
run: |
|
run: |
|
||||||
$xmlDirectory = Join-Path $HOME ".m2"
|
$xmlDirectory = Join-Path $HOME ".m2"
|
||||||
@ -133,7 +133,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -150,4 +150,4 @@ jobs:
|
|||||||
$path = Join-Path $env:RUNNER_TEMP "settings.xml"
|
$path = Join-Path $env:RUNNER_TEMP "settings.xml"
|
||||||
if (-not (Test-Path $path)) {
|
if (-not (Test-Path $path)) {
|
||||||
throw "settings.xml file is not found in expected location"
|
throw "settings.xml file is not found in expected location"
|
||||||
}
|
}
|
272
.github/workflows/e2e-versions.yml
vendored
272
.github/workflows/e2e-versions.yml
vendored
@ -11,7 +11,7 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 */12 * * *'
|
- cron: '0 */12 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
setup-java-major-versions:
|
setup-java-major-versions:
|
||||||
@ -20,59 +20,31 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: [
|
distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft', 'corretto' ] # internally 'adopt-hotspot' is the same as 'adopt'
|
||||||
'temurin',
|
version: ['8', '11', '16']
|
||||||
'adopt',
|
|
||||||
'adopt-openj9',
|
|
||||||
'zulu',
|
|
||||||
'liberica',
|
|
||||||
'microsoft',
|
|
||||||
'semeru',
|
|
||||||
'corretto',
|
|
||||||
'dragonwell',
|
|
||||||
'sapmachine',
|
|
||||||
'jetbrains'
|
|
||||||
] # internally 'adopt-hotspot' is the same as 'adopt'
|
|
||||||
version: ['21', '11', '17']
|
|
||||||
exclude:
|
exclude:
|
||||||
- distribution: microsoft
|
- distribution: microsoft
|
||||||
version: 8
|
version: 8
|
||||||
- distribution: dragonwell
|
|
||||||
os: macos-13
|
|
||||||
include:
|
include:
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: macos-13
|
os: macos-latest
|
||||||
version: 17
|
version: 17
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
version: 21
|
version: 19
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: 21
|
version: 19
|
||||||
- distribution: graalvm
|
|
||||||
os: macos-latest
|
|
||||||
version: 17.0.12
|
|
||||||
- distribution: graalvm
|
|
||||||
os: windows-latest
|
|
||||||
version: 21
|
|
||||||
- distribution: graalvm
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: 21
|
|
||||||
- distribution: graalvm
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '24-ea'
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- 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: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -87,34 +59,16 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['temurin', 'zulu', 'liberica']
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
version:
|
version:
|
||||||
- '11.0'
|
- '11.0'
|
||||||
- '21.0'
|
- '8.0.302'
|
||||||
- '17.0.7+7'
|
- '16.0.2+7'
|
||||||
include:
|
include:
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: '21.0.4'
|
version: '19.0.1'
|
||||||
- distribution: graalvm
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '21.0.4'
|
|
||||||
- distribution: dragonwell
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '11.0'
|
|
||||||
- distribution: dragonwell
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '11.0.13+9'
|
|
||||||
- distribution: sapmachine
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '17.0.7'
|
|
||||||
- distribution: jetbrains
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '11.0.11'
|
|
||||||
- distribution: jetbrains
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '17.0.7'
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -124,8 +78,6 @@ jobs:
|
|||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
setup-java-check-latest:
|
setup-java-check-latest:
|
||||||
name: ${{ matrix.distribution }} ${{ matrix.version }} - check-latest flag - ${{ matrix.os }}
|
name: ${{ matrix.distribution }} ${{ matrix.version }} - check-latest flag - ${{ matrix.os }}
|
||||||
@ -135,21 +87,10 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
[
|
|
||||||
'temurin',
|
|
||||||
'zulu',
|
|
||||||
'liberica',
|
|
||||||
'dragonwell',
|
|
||||||
'sapmachine',
|
|
||||||
'jetbrains'
|
|
||||||
]
|
|
||||||
exclude:
|
|
||||||
- distribution: dragonwell
|
|
||||||
os: macos-latest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -157,8 +98,6 @@ jobs:
|
|||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
java-version: 11
|
java-version: 11
|
||||||
check-latest: true
|
check-latest: true
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -171,21 +110,10 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
[
|
|
||||||
'temurin',
|
|
||||||
'zulu',
|
|
||||||
'liberica',
|
|
||||||
'dragonwell',
|
|
||||||
'sapmachine',
|
|
||||||
'jetbrains'
|
|
||||||
]
|
|
||||||
exclude:
|
|
||||||
- distribution: dragonwell
|
|
||||||
os: macos-latest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -194,8 +122,6 @@ jobs:
|
|||||||
java-version: |
|
java-version: |
|
||||||
11
|
11
|
||||||
17
|
17
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Verify Java env variables
|
- name: Verify Java env variables
|
||||||
run: |
|
run: |
|
||||||
$versionsArr = "11","17"
|
$versionsArr = "11","17"
|
||||||
@ -203,10 +129,10 @@ jobs:
|
|||||||
{
|
{
|
||||||
$envName = "JAVA_HOME_${version}_${env:RUNNER_ARCH}"
|
$envName = "JAVA_HOME_${version}_${env:RUNNER_ARCH}"
|
||||||
$JavaVersionPath = [Environment]::GetEnvironmentVariable($envName)
|
$JavaVersionPath = [Environment]::GetEnvironmentVariable($envName)
|
||||||
if (-not (Test-Path "$JavaVersionPath")) {
|
if (-not (Test-Path "$JavaVersionPath")) {
|
||||||
Write-Host "$envName is not found"
|
Write-Host "$envName is not found"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
@ -220,11 +146,11 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
version: ['17-ea', '15.0.0-ea.14']
|
version: ['17-ea', '15.0.0-ea.14']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -246,7 +172,7 @@ jobs:
|
|||||||
version: ['17-ea']
|
version: ['17-ea']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -257,28 +183,6 @@ jobs:
|
|||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
setup-java-ea-versions-sapmachine:
|
|
||||||
name: sapmachine ${{ matrix.version }} (jdk-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@v4
|
|
||||||
- name: setup-java
|
|
||||||
uses: ./
|
|
||||||
id: setup-java
|
|
||||||
with:
|
|
||||||
java-version: ${{ matrix.version }}
|
|
||||||
distribution: sapmachine
|
|
||||||
- name: Verify Java
|
|
||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.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
|
||||||
@ -286,23 +190,22 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine', 'jetbrains']
|
|
||||||
java-package: ['jre']
|
java-package: ['jre']
|
||||||
version: ['17.0']
|
version: ['17.0']
|
||||||
include:
|
include:
|
||||||
- distribution: 'zulu'
|
- distribution: 'zulu'
|
||||||
java-package: jre+fx
|
java-package: jre+fx
|
||||||
version: '21'
|
version: '8'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
- distribution: 'zulu'
|
- distribution: 'zulu'
|
||||||
java-package: jdk+fx
|
java-package: jdk+fx
|
||||||
version: '21.0'
|
version: '8.0.242'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
- distribution: 'liberica'
|
- distribution: 'liberica'
|
||||||
java-package: jdk+fx
|
java-package: jdk+fx
|
||||||
version: '21'
|
version: '8'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
- distribution: 'liberica'
|
- distribution: 'liberica'
|
||||||
java-package: jre+fx
|
java-package: jre+fx
|
||||||
@ -312,50 +215,9 @@ jobs:
|
|||||||
java-package: jre
|
java-package: jre
|
||||||
version: '8'
|
version: '8'
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jdk+jcef
|
|
||||||
version: '11'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jdk+jcef
|
|
||||||
version: '17'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jdk+jcef
|
|
||||||
version: '21'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jre+jcef
|
|
||||||
version: '11'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jre+jcef
|
|
||||||
version: '17'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jre+jcef
|
|
||||||
version: '21'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jdk+ft
|
|
||||||
version: '17'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jdk+ft
|
|
||||||
version: '21'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jre+ft
|
|
||||||
version: '17'
|
|
||||||
os: ubuntu-latest
|
|
||||||
- distribution: 'jetbrains'
|
|
||||||
java-package: jre+ft
|
|
||||||
version: '21'
|
|
||||||
os: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -363,8 +225,6 @@ jobs:
|
|||||||
java-version: ${{ matrix.version }}
|
java-version: ${{ matrix.version }}
|
||||||
java-package: ${{ matrix.java-package }}
|
java-package: ${{ matrix.java-package }}
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -378,12 +238,12 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# x86 is not supported on macOS
|
# x86 is not supported on macOS
|
||||||
os: [windows-latest, ubuntu-22.04]
|
os: [windows-latest, ubuntu-latest]
|
||||||
distribution: ['liberica', 'zulu', 'corretto']
|
distribution: ['liberica', 'zulu', 'corretto']
|
||||||
version: ['11']
|
version: ['11']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
@ -402,24 +262,20 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['temurin', 'microsoft', 'corretto']
|
distribution: ['temurin', 'microsoft', 'corretto' ]
|
||||||
java-version-file: ['.java-version', '.tool-versions']
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "17" > .java-version
|
run: echo "8" > .java-version
|
||||||
- name: Create .tool-versions file
|
|
||||||
shell: bash
|
|
||||||
run: echo "java 17" > .tool-versions
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
java-version: 11
|
java-version: 11
|
||||||
java-version-file: ${{matrix.java-version-file }}
|
java-version-file: '.java-version'
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -431,23 +287,19 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto']
|
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto' ]
|
||||||
java-version-file: ['.java-version', '.tool-versions']
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "11" > .java-version
|
run: echo "11" > .java-version
|
||||||
- name: Create .tool-versions file
|
|
||||||
shell: bash
|
|
||||||
run: echo "java 11" > .tool-versions
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
java-version-file: ${{matrix.java-version-file }}
|
java-version-file: '.java-version'
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -459,51 +311,43 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['adopt', 'adopt-openj9', 'zulu']
|
distribution: [ 'adopt', 'adopt-openj9', 'zulu' ]
|
||||||
java-version-file: ['.java-version', '.tool-versions']
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- name: Create .java-version file
|
- name: Create .java-version file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "17.0.10" > .java-version
|
run: echo "11.0.2" > .java-version
|
||||||
- name: Create .tool-versions file
|
|
||||||
shell: bash
|
|
||||||
run: echo "java 17.0.10" > .tool-versions
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
java-version-file: ${{matrix.java-version-file }}
|
java-version-file: '.java-version'
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "17.0.10" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "11.0.2" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
setup-java-version-from-file-major-minor-patch-with-dist:
|
setup-java-version-from-file-major-minor-patch-with-dist:
|
||||||
name: ${{ matrix.distribution }} version from file 'openjdk64-17.0.10' - ${{ matrix.os }}
|
name: ${{ matrix.distribution }} version from file 'openjdk64-11.0.2' - ${{ matrix.os }}
|
||||||
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: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['adopt', 'zulu', 'liberica']
|
distribution: ['adopt', 'zulu', 'liberica' ]
|
||||||
java-version-file: ['.java-version', '.tool-versions']
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
- 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-11.0.2" > .java-version
|
||||||
- name: Create .tool-versions file
|
|
||||||
shell: bash
|
|
||||||
run: echo "java openjdk64-17.0.10" > .tool-versions
|
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
with:
|
with:
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
java-version-file: ${{matrix.java-version-file }}
|
java-version-file: '.java-version'
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "17.0.10" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "11.0.2" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
21
.github/workflows/publish-immutable-actions.yml
vendored
21
.github/workflows/publish-immutable-actions.yml
vendored
@ -1,21 +0,0 @@
|
|||||||
name: 'Publish Immutable Action Version'
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [released]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checking out
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Publish
|
|
||||||
id: publish
|
|
||||||
uses: actions/publish-immutable-action@v0.0.4
|
|
12
.github/workflows/release-new-action-version.yml
vendored
12
.github/workflows/release-new-action-version.yml
vendored
@ -21,9 +21,9 @@ jobs:
|
|||||||
name: releaseNewActionVersion
|
name: releaseNewActionVersion
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update the ${{ env.TAG_NAME }} tag
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
id: update-major-tag
|
id: update-major-tag
|
||||||
uses: actions/publish-action@v0.3.0
|
uses: actions/publish-action@v0.2.2
|
||||||
with:
|
with:
|
||||||
source-tag: ${{ env.TAG_NAME }}
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
11
.github/workflows/update-config-files.yml
vendored
11
.github/workflows/update-config-files.yml
vendored
@ -1,11 +0,0 @@
|
|||||||
name: Update configuration files
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 3 * * 0'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
call-update-configuration-files:
|
|
||||||
name: Update configuration files
|
|
||||||
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main
|
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -94,6 +94,3 @@ typings/
|
|||||||
# DynamoDB Local files
|
# DynamoDB Local files
|
||||||
.dynamodb/
|
.dynamodb/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
# IntelliJ / WebStorm
|
|
||||||
/.idea/
|
|
||||||
|
BIN
.licenses/npm/@actions/cache.dep.yml
generated
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/core.dep.yml
generated
BIN
.licenses/npm/@actions/core.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/exec.dep.yml
generated
BIN
.licenses/npm/@actions/exec.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@actions/http-client-1.0.11.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/http-client-1.0.11.dep.yml
generated
Normal file
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@actions/io.dep.yml
generated
BIN
.licenses/npm/@actions/io.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/tool-cache.dep.yml
generated
BIN
.licenses/npm/@actions/tool-cache.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/abort-controller.dep.yml
generated
BIN
.licenses/npm/@azure/abort-controller.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-http.dep.yml
generated
BIN
.licenses/npm/@azure/core-http.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/logger.dep.yml
generated
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@fastify/busboy.dep.yml
generated
BIN
.licenses/npm/@fastify/busboy.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node-14.6.2.dep.yml
generated
Normal file
BIN
.licenses/npm/@types/node-14.6.2.dep.yml
generated
Normal file
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/balanced-match.dep.yml
generated
BIN
.licenses/npm/balanced-match.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/form-data-3.0.1.dep.yml
generated
Normal file
BIN
.licenses/npm/form-data-3.0.1.dep.yml
generated
Normal file
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/lru-cache.dep.yml
generated
Normal file
BIN
.licenses/npm/lru-cache.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/mime-db.dep.yml
generated
BIN
.licenses/npm/mime-db.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/mime-types.dep.yml
generated
BIN
.licenses/npm/mime-types.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/node-fetch.dep.yml
generated
BIN
.licenses/npm/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/psl.dep.yml
generated
Normal file
BIN
.licenses/npm/psl.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/punycode.dep.yml
generated
Normal file
BIN
.licenses/npm/punycode.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/sax.dep.yml
generated
BIN
.licenses/npm/sax.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/tough-cookie-3.0.1.dep.yml
generated
Normal file
BIN
.licenses/npm/tough-cookie-3.0.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tough-cookie-4.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/tough-cookie-4.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tslib-2.3.1.dep.yml
generated
Normal file
BIN
.licenses/npm/tslib-2.3.1.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/tslib-2.6.2.dep.yml
generated
BIN
.licenses/npm/tslib-2.6.2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/typescript.dep.yml
generated
BIN
.licenses/npm/typescript.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/undici-types.dep.yml
generated
BIN
.licenses/npm/undici-types.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/universalify.dep.yml
generated
Normal file
BIN
.licenses/npm/universalify.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/xml2js.dep.yml
generated
BIN
.licenses/npm/xml2js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/xmlbuilder2.dep.yml
generated
BIN
.licenses/npm/xmlbuilder2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/yallist.dep.yml
generated
Normal file
BIN
.licenses/npm/yallist.dep.yml
generated
Normal file
Binary file not shown.
@ -1,7 +0,0 @@
|
|||||||
# Ignore list
|
|
||||||
/*
|
|
||||||
|
|
||||||
# Do not ignore these folders:
|
|
||||||
!__tests__/
|
|
||||||
!.github/
|
|
||||||
!src/
|
|
@ -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'
|
|
||||||
};
|
|
11
.prettierrc.json
Normal file
11
.prettierrc.json
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 100,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"parser": "typescript"
|
||||||
|
}
|
121
README.md
121
README.md
@ -5,7 +5,7 @@
|
|||||||
[](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml)
|
[](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml)
|
||||||
|
|
||||||
The `setup-java` action provides the following functionality for GitHub Actions runners:
|
The `setup-java` action provides the following functionality for GitHub Actions runners:
|
||||||
- Downloading and setting up a requested version of Java. See [Usage](#usage) for a list of supported distributions.
|
- Downloading and setting up a requested version of Java. See [Usage](#Usage) for a list of supported distributions.
|
||||||
- Extracting and caching custom version of Java from a local file.
|
- Extracting and caching custom version of Java from a local file.
|
||||||
- Configuring runner for publishing using Apache Maven.
|
- Configuring runner for publishing using Apache Maven.
|
||||||
- Configuring runner for publishing using Gradle.
|
- Configuring runner for publishing using Gradle.
|
||||||
@ -27,11 +27,11 @@ This action allows you to work with Java and Scala projects.
|
|||||||
|
|
||||||
- `java-version`: The Java version that is going to be set up. Takes a whole or [semver](#supported-version-syntax) Java version. If not specified, the action will expect `java-version-file` input to be specified.
|
- `java-version`: The Java version that is going to be set up. Takes a whole or [semver](#supported-version-syntax) Java version. If not specified, the action will expect `java-version-file` input to be specified.
|
||||||
|
|
||||||
- `java-version-file`: The path to a file containing java version. Supported file types are `.java-version` and `.tool-versions`. See more details in [about .java-version-file](docs/advanced-usage.md#Java-version-file).
|
- `java-version-file`: The path to the `.java-version` file. See more details in [about `.java-version` file](docs/advanced-usage.md#Java-version-file).
|
||||||
|
|
||||||
- `distribution`: _(required)_ Java [distribution](#supported-distributions).
|
- `distribution`: _(required)_ Java [distribution](#supported-distributions).
|
||||||
|
|
||||||
- `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 choosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. 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.
|
||||||
|
|
||||||
@ -39,14 +39,12 @@ This action allows you to work with Java and Scala projects.
|
|||||||
|
|
||||||
- `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.
|
||||||
|
|
||||||
- `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 predifined 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.
|
|
||||||
|
|
||||||
#### Maven options
|
#### Maven options
|
||||||
The action has a bunch of inputs to generate maven's [settings.xml](https://maven.apache.org/settings.html) on the fly and pass the values to Apache Maven GPG Plugin as well as Apache Maven Toolchains. See [advanced usage](docs/advanced-usage.md) for more.
|
The action has a bunch of inputs to generate maven's [settings.xml](https://maven.apache.org/settings.html) on the fly and pass the values to Apache Maven GPG Plugin as well as Apache Maven Toolchains. See [advanced usage](docs/advanced-usage.md) for more.
|
||||||
|
|
||||||
- `overwrite-settings`: By default action overwrites the settings.xml. In order to skip generation of file if it exists, set this to `false`.
|
- `overwrite-settings`: By default action overwrites the settings.xml. In order to skip generation of file if it exists set this to `false`.
|
||||||
|
|
||||||
- `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`.
|
||||||
|
|
||||||
@ -58,7 +56,7 @@ This action allows you to work with Java and Scala projects.
|
|||||||
|
|
||||||
- `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`: description: 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.
|
||||||
|
|
||||||
@ -69,30 +67,30 @@ This action allows you to work with Java and Scala projects.
|
|||||||
#### Eclipse Temurin
|
#### Eclipse Temurin
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin' # See 'Supported distributions' for available options
|
distribution: 'temurin' # See 'Supported distributions' for available options
|
||||||
java-version: '21'
|
java-version: '17'
|
||||||
- run: java HelloWorldApp.java
|
- run: java HelloWorldApp.java
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Azul Zulu OpenJDK
|
#### Azul Zulu OpenJDK
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'zulu' # See 'Supported distributions' for available options
|
distribution: 'zulu' # See 'Supported distributions' for available options
|
||||||
java-version: '21'
|
java-version: '17'
|
||||||
- run: java HelloWorldApp.java
|
- run: java HelloWorldApp.java
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 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 `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation:
|
||||||
- major versions: `8`, `11`, `16`, `17`, `21`
|
- major versions: `8`, `11`, `16`, `17`
|
||||||
- more specific versions: `8.0.282+8`, `8.0.232`, `11.0`, `11.0.4`, `17.0`
|
- more specific versions: `17.0`, `11.0`, `11.0.4`, `8.0.232`, `8.0.282+8`
|
||||||
- early access (EA) versions: `15-ea`, `15.0.0-ea`
|
- early access (EA) versions: `15-ea`, `15.0.0-ea`, `15.0.0-ea.2`, `15.0.0+2-ea`
|
||||||
|
|
||||||
#### Supported distributions
|
#### Supported distributions
|
||||||
Currently, the following distributions are supported:
|
Currently, the following distributions are supported:
|
||||||
@ -105,29 +103,19 @@ Currently, the following distributions are supported:
|
|||||||
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
|
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
|
||||||
| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
|
| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
|
||||||
| `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/)
|
| `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/)
|
||||||
| `semeru` | IBM Semeru Runtime Open Edition | [Link](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/) | [Link](https://openjdk.java.net/legal/gplv2+ce.html) |
|
|
||||||
| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense)
|
| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense)
|
||||||
| `dragonwell` | Alibaba Dragonwell JDK | [Link](https://dragonwell-jdk.io/) | [Link](https://www.aliyun.com/product/dragonwell/)
|
|
||||||
| `sapmachine` | SAP SapMachine JDK/JRE | [Link](https://sapmachine.io/) | [Link](https://github.com/SAP/SapMachine/blob/sapmachine/LICENSE)
|
|
||||||
| `graalvm` | Oracle GraalVM | [Link](https://www.graalvm.org/) | [Link](https://www.oracle.com/downloads/licenses/graal-free-license.html)
|
|
||||||
| `jetbrains` | JetBrains Runtime | [Link](https://github.com/JetBrains/JetBrainsRuntime/) | [Link](https://github.com/JetBrains/JetBrainsRuntime/blob/main/LICENSE)
|
|
||||||
|
|
||||||
**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.
|
**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.
|
||||||
|
|
||||||
**NOTE:** 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/).
|
**NOTE:** AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` to `temurin` 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/).
|
||||||
|
|
||||||
**NOTE:** For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
|
**NOTE:** For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
|
||||||
|
|
||||||
**NOTE:** 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.
|
|
||||||
|
|
||||||
### Caching packages dependencies
|
### Caching packages dependencies
|
||||||
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 [actions/cache](https://github.com/actions/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`, and `gradle/*.versions.toml`
|
||||||
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, and `**/versions.properties`
|
|
||||||
- maven: `**/pom.xml`
|
- maven: `**/pom.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,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.
|
|
||||||
|
|
||||||
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).
|
||||||
|
|
||||||
@ -136,28 +124,24 @@ The cache input is optional, and caching is turned off by default.
|
|||||||
#### Caching gradle dependencies
|
#### Caching gradle dependencies
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '17'
|
||||||
cache: 'gradle'
|
cache: 'gradle'
|
||||||
cache-dependency-path: | # optional
|
|
||||||
sub-project/*.gradle*
|
|
||||||
sub-project/**/gradle-wrapper.properties
|
|
||||||
- run: ./gradlew build --no-daemon
|
- run: ./gradlew build --no-daemon
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Caching maven dependencies
|
#### Caching maven dependencies
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '17'
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
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 -B package --file pom.xml
|
||||||
```
|
```
|
||||||
@ -165,35 +149,16 @@ steps:
|
|||||||
#### Caching sbt dependencies
|
#### Caching sbt dependencies
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '17'
|
||||||
cache: 'sbt'
|
cache: 'sbt'
|
||||||
cache-dependency-path: | # optional
|
|
||||||
sub-project/build.sbt
|
|
||||||
sub-project/project/build.properties
|
|
||||||
- name: Build with SBT
|
- name: Build with SBT
|
||||||
run: sbt package
|
run: sbt package
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Cache segment restore timeout
|
|
||||||
Usually, cache gets downloaded in multiple segments of fixed sizes. Sometimes, a segment download gets stuck, which causes the workflow job to be stuck. The cache segment download timeout [was introduced](https://github.com/actions/toolkit/tree/main/packages/cache#cache-segment-restore-timeout) to solve this issue as it allows the segment download to get aborted and hence allows the job to proceed with a cache miss. The default value of the cache segment download timeout is set to 10 minutes and can be customized by specifying an environment variable named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with a timeout value in minutes.
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
env:
|
|
||||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: '21'
|
|
||||||
cache: 'gradle'
|
|
||||||
- run: ./gradlew build --no-daemon
|
|
||||||
```
|
|
||||||
|
|
||||||
### Check latest
|
### Check latest
|
||||||
|
|
||||||
In the basic examples above, the `check-latest` flag defaults to `false`. When set to `false`, the action tries to first resolve a version of Java from the local tool cache on the runner. If unable to find a specific version in the cache, the action will download a version of Java. Use the default or set `check-latest` to `false` if you prefer a faster more consistent setup experience that prioritizes trying to use the cached versions at the expense of newer versions sometimes being available for download.
|
In the basic examples above, the `check-latest` flag defaults to `false`. When set to `false`, the action tries to first resolve a version of Java from the local tool cache on the runner. If unable to find a specific version in the cache, the action will download a version of Java. Use the default or set `check-latest` to `false` if you prefer a faster more consistent setup experience that prioritizes trying to use the cached versions at the expense of newer versions sometimes being available for download.
|
||||||
@ -205,11 +170,11 @@ For Java distributions that are not cached on Hosted images, `check-latest` alwa
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '21'
|
java-version: '17'
|
||||||
check-latest: true
|
check-latest: true
|
||||||
- run: java HelloWorldApp.java
|
- run: java HelloWorldApp.java
|
||||||
```
|
```
|
||||||
@ -221,12 +186,12 @@ jobs:
|
|||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
java: [ '8', '11', '17', '21' ]
|
java: [ '8', '11', '17' ]
|
||||||
name: Java ${{ matrix.Java }} sample
|
name: Java ${{ matrix.Java }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: Setup java
|
- name: Setup java
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: ${{ matrix.java }}
|
java-version: ${{ matrix.java }}
|
||||||
@ -239,7 +204,7 @@ All versions are added to the PATH. The last version will be used and available
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-java@v4
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: |
|
java-version: |
|
||||||
@ -260,10 +225,6 @@ In the example above multiple JDKs are installed for the same job. The result af
|
|||||||
- [Liberica](docs/advanced-usage.md#Liberica)
|
- [Liberica](docs/advanced-usage.md#Liberica)
|
||||||
- [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)
|
|
||||||
- [Alibaba Dragonwell](docs/advanced-usage.md#Alibaba-Dragonwell)
|
|
||||||
- [SapMachine](docs/advanced-usage.md#SapMachine)
|
|
||||||
- [GraalVM](docs/advanced-usage.md#GraalVM)
|
|
||||||
- [Installing custom Java package type](docs/advanced-usage.md#Installing-custom-Java-package-type)
|
- [Installing custom Java package type](docs/advanced-usage.md#Installing-custom-Java-package-type)
|
||||||
- [Installing custom Java architecture](docs/advanced-usage.md#Installing-custom-Java-architecture)
|
- [Installing custom Java architecture](docs/advanced-usage.md#Installing-custom-Java-architecture)
|
||||||
- [Installing custom Java distribution from local file](docs/advanced-usage.md#Installing-Java-from-local-file)
|
- [Installing custom Java distribution from local file](docs/advanced-usage.md#Installing-Java-from-local-file)
|
||||||
@ -273,16 +234,6 @@ In the example above multiple JDKs are installed for the same job. The result af
|
|||||||
- [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)
|
|
||||||
|
|
||||||
## 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:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
permissions:
|
|
||||||
contents: read # access to check out code and install dependencies
|
|
||||||
```
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import * as io from '@actions/io';
|
import io = require('@actions/io');
|
||||||
|
import fs = require('fs');
|
||||||
|
import path = require('path');
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as path from 'path';
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import * as auth from '../src/auth';
|
import * as auth from '../src/auth';
|
||||||
import {M2_DIR, MVN_SETTINGS_FILE} from '../src/constants';
|
import { M2_DIR, MVN_SETTINGS_FILE } from '../src/constants';
|
||||||
|
|
||||||
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);
|
||||||
@ -42,13 +42,7 @@ describe('auth tests', () => {
|
|||||||
const altSettingsFile = path.join(altHome, MVN_SETTINGS_FILE);
|
const altSettingsFile = path.join(altHome, MVN_SETTINGS_FILE);
|
||||||
await io.rmRF(altHome); // ensure it doesn't already exist
|
await io.rmRF(altHome); // ensure it doesn't already exist
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, altHome, true);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
altHome,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(false);
|
expect(fs.existsSync(m2Dir)).toBe(false);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(false);
|
expect(fs.existsSync(settingsFile)).toBe(false);
|
||||||
@ -67,19 +61,11 @@ describe('auth tests', () => {
|
|||||||
const username = 'UNAME';
|
const username = 'UNAME';
|
||||||
const password = 'TOKEN';
|
const password = 'TOKEN';
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, m2Dir, true);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
m2Dir,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(auth.generate(id, username, password));
|
||||||
auth.generate(id, username, password)
|
|
||||||
);
|
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
it('creates settings.xml with additional configuration', async () => {
|
it('creates settings.xml with additional configuration', async () => {
|
||||||
@ -88,14 +74,7 @@ describe('auth tests', () => {
|
|||||||
const password = 'TOKEN';
|
const password = 'TOKEN';
|
||||||
const gpgPassphrase = 'GPG';
|
const gpgPassphrase = 'GPG';
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, m2Dir, true, gpgPassphrase);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
m2Dir,
|
|
||||||
true,
|
|
||||||
gpgPassphrase
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
@ -109,24 +88,16 @@ describe('auth tests', () => {
|
|||||||
const username = 'USERNAME';
|
const username = 'USERNAME';
|
||||||
const password = 'PASSWORD';
|
const password = 'PASSWORD';
|
||||||
|
|
||||||
fs.mkdirSync(m2Dir, {recursive: true});
|
fs.mkdirSync(m2Dir, { recursive: true });
|
||||||
fs.writeFileSync(settingsFile, 'FAKE FILE');
|
fs.writeFileSync(settingsFile, 'FAKE FILE');
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, m2Dir, true);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
m2Dir,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(auth.generate(id, username, password));
|
||||||
auth.generate(id, username, password)
|
|
||||||
);
|
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
it('does not overwrite existing settings.xml files', async () => {
|
it('does not overwrite existing settings.xml files', async () => {
|
||||||
@ -134,18 +105,12 @@ describe('auth tests', () => {
|
|||||||
const username = 'USERNAME';
|
const username = 'USERNAME';
|
||||||
const password = 'PASSWORD';
|
const password = 'PASSWORD';
|
||||||
|
|
||||||
fs.mkdirSync(m2Dir, {recursive: true});
|
fs.mkdirSync(m2Dir, { recursive: true });
|
||||||
fs.writeFileSync(settingsFile, 'FAKE FILE');
|
fs.writeFileSync(settingsFile, 'FAKE FILE');
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, m2Dir, false);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
m2Dir,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
@ -194,8 +159,6 @@ describe('auth tests', () => {
|
|||||||
</servers>
|
</servers>
|
||||||
</settings>`;
|
</settings>`;
|
||||||
|
|
||||||
expect(auth.generate(id, username, password, gpgPassphrase)).toEqual(
|
expect(auth.generate(id, username, password, gpgPassphrase)).toEqual(expectedSettings);
|
||||||
expectedSettings
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
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 { 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 core from '@actions/core';
|
||||||
import * as cache from '@actions/cache';
|
import * as cache from '@actions/cache';
|
||||||
import * as glob from '@actions/glob';
|
|
||||||
|
|
||||||
describe('dependency cache', () => {
|
describe('dependency cache', () => {
|
||||||
const ORIGINAL_RUNNER_OS = process.env['RUNNER_OS'];
|
const ORIGINAL_RUNNER_OS = process.env['RUNNER_OS'];
|
||||||
@ -65,30 +64,21 @@ describe('dependency cache', () => {
|
|||||||
ReturnType<typeof cache.restoreCache>,
|
ReturnType<typeof cache.restoreCache>,
|
||||||
Parameters<typeof cache.restoreCache>
|
Parameters<typeof cache.restoreCache>
|
||||||
>;
|
>;
|
||||||
let spyGlobHashFiles: jest.SpyInstance<
|
|
||||||
ReturnType<typeof glob.hashFiles>,
|
|
||||||
Parameters<typeof glob.hashFiles>
|
|
||||||
>;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyCacheRestore = jest
|
spyCacheRestore = jest
|
||||||
.spyOn(cache, 'restoreCache')
|
.spyOn(cache, 'restoreCache')
|
||||||
.mockImplementation((paths: string[], primaryKey: string) =>
|
.mockImplementation((paths: string[], primaryKey: string) => Promise.resolve(undefined));
|
||||||
Promise.resolve(undefined)
|
|
||||||
);
|
|
||||||
spyGlobHashFiles = jest.spyOn(glob, 'hashFiles');
|
|
||||||
spyWarning.mockImplementation(() => null);
|
spyWarning.mockImplementation(() => null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws error if unsupported package manager specified', () => {
|
it('throws error if unsupported package manager specified', () => {
|
||||||
return expect(restore('ant', '')).rejects.toThrow(
|
return expect(restore('ant')).rejects.toThrowError('unknown package manager specified: ant');
|
||||||
'unknown package manager specified: ant'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('for maven', () => {
|
describe('for maven', () => {
|
||||||
it('throws error if no pom.xml found', async () => {
|
it('throws error if no pom.xml found', async () => {
|
||||||
await expect(restore('maven', '')).rejects.toThrow(
|
await expect(restore('maven')).rejects.toThrowError(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
)} matched to [**/pom.xml], make sure you have checked out the target repository`
|
)} matched to [**/pom.xml], make sure you have checked out the target repository`
|
||||||
@ -97,160 +87,70 @@ describe('dependency cache', () => {
|
|||||||
it('downloads cache', async () => {
|
it('downloads cache', async () => {
|
||||||
createFile(join(workspace, 'pom.xml'));
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
|
||||||
await restore('maven', '');
|
await restore('maven');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith('**/pom.xml');
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyInfo).toBeCalledWith('maven cache is not found');
|
||||||
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('for gradle', () => {
|
describe('for gradle', () => {
|
||||||
it('throws error if no build.gradle found', async () => {
|
it('throws error if no build.gradle found', async () => {
|
||||||
await expect(restore('gradle', '')).rejects.toThrow(
|
await expect(restore('gradle')).rejects.toThrowError(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
)} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt,gradle/*.versions.toml,**/versions.properties], make sure you have checked out the target repository`
|
)} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt,gradle/*.versions.toml], make sure you have checked out the target repository`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('downloads cache based on build.gradle', async () => {
|
it('downloads cache based on build.gradle', async () => {
|
||||||
createFile(join(workspace, 'build.gradle'));
|
createFile(join(workspace, 'build.gradle'));
|
||||||
|
|
||||||
await restore('gradle', '');
|
await restore('gradle');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyWarning).not.toBeCalled();
|
||||||
'**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
|
expect(spyInfo).toBeCalledWith('gradle cache is not found');
|
||||||
);
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
});
|
});
|
||||||
it('downloads cache based on build.gradle.kts', async () => {
|
it('downloads cache based on build.gradle.kts', async () => {
|
||||||
createFile(join(workspace, 'build.gradle.kts'));
|
createFile(join(workspace, 'build.gradle.kts'));
|
||||||
|
|
||||||
await restore('gradle', '');
|
await restore('gradle');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyWarning).not.toBeCalled();
|
||||||
'**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
|
expect(spyInfo).toBeCalledWith('gradle cache is not found');
|
||||||
);
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
});
|
});
|
||||||
it('downloads cache based on libs.versions.toml', async () => {
|
it('downloads cache based on libs.versions.toml', async () => {
|
||||||
createDirectory(join(workspace, 'gradle'));
|
createDirectory(join(workspace, 'gradle'));
|
||||||
createFile(join(workspace, 'gradle', 'libs.versions.toml'));
|
createFile(join(workspace, 'gradle', 'libs.versions.toml'));
|
||||||
|
|
||||||
await restore('gradle', '');
|
await restore('gradle');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyWarning).not.toBeCalled();
|
||||||
'**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
|
expect(spyInfo).toBeCalledWith('gradle cache is not found');
|
||||||
);
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
});
|
});
|
||||||
it('downloads cache based on buildSrc/Versions.kt', async () => {
|
});
|
||||||
createDirectory(join(workspace, 'buildSrc'));
|
it('downloads cache based on buildSrc/Versions.kt', async () => {
|
||||||
createFile(join(workspace, 'buildSrc', 'Versions.kt'));
|
createDirectory(join(workspace, 'buildSrc'));
|
||||||
|
createFile(join(workspace, 'buildSrc', 'Versions.kt'));
|
||||||
|
|
||||||
await restore('gradle', '');
|
await restore('gradle');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyWarning).not.toBeCalled();
|
||||||
'**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
|
expect(spyInfo).toBeCalledWith('gradle cache is not found');
|
||||||
);
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
describe('for sbt', () => {
|
describe('for sbt', () => {
|
||||||
it('throws error if no build.sbt found', async () => {
|
it('throws error if no build.sbt found', async () => {
|
||||||
await expect(restore('sbt', '')).rejects.toThrow(
|
await expect(restore('sbt')).rejects.toThrowError(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
)} matched to [**/*.sbt,**/project/build.properties,**/project/**.scala,**/project/**.sbt], make sure you have checked out the target repository`
|
)} matched to [**/*.sbt,**/project/build.properties,**/project/**.{scala,sbt}], make sure you have checked out the target repository`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('downloads cache', async () => {
|
it('downloads cache', async () => {
|
||||||
createFile(join(workspace, 'build.sbt'));
|
createFile(join(workspace, 'build.sbt'));
|
||||||
|
|
||||||
await restore('sbt', '');
|
await restore('sbt');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
expect(spyWarning).not.toBeCalled();
|
||||||
'**/*.sbt\n**/project/build.properties\n**/project/**.scala\n**/project/**.sbt'
|
expect(spyInfo).toBeCalledWith('sbt cache is not found');
|
||||||
);
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('sbt cache is not found');
|
|
||||||
});
|
|
||||||
it('detects scala and sbt changes under **/project/ folder', async () => {
|
|
||||||
createFile(join(workspace, 'build.sbt'));
|
|
||||||
createDirectory(join(workspace, 'project'));
|
|
||||||
createFile(join(workspace, 'project/DependenciesV1.scala'));
|
|
||||||
|
|
||||||
await restore('sbt', '');
|
|
||||||
const firstCall = spySaveState.mock.calls.toString();
|
|
||||||
|
|
||||||
spySaveState.mockClear();
|
|
||||||
await restore('sbt', '');
|
|
||||||
const secondCall = spySaveState.mock.calls.toString();
|
|
||||||
|
|
||||||
// Make sure multiple restores produce the same cache
|
|
||||||
expect(firstCall).toBe(secondCall);
|
|
||||||
|
|
||||||
spySaveState.mockClear();
|
|
||||||
createFile(join(workspace, 'project/DependenciesV2.scala'));
|
|
||||||
await restore('sbt', '');
|
|
||||||
const thirdCall = spySaveState.mock.calls.toString();
|
|
||||||
|
|
||||||
expect(firstCall).not.toBe(thirdCall);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
it('downloads cache based on versions.properties', async () => {
|
|
||||||
createFile(join(workspace, 'versions.properties'));
|
|
||||||
|
|
||||||
await restore('gradle', '');
|
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
|
||||||
'**/*.gradle*\n**/gradle-wrapper.properties\nbuildSrc/**/Versions.kt\nbuildSrc/**/Dependencies.kt\ngradle/*.versions.toml\n**/versions.properties'
|
|
||||||
);
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
});
|
|
||||||
describe('cache-dependency-path', () => {
|
|
||||||
it('throws error if no matching dependency file found', async () => {
|
|
||||||
createFile(join(workspace, 'build.gradle.kts'));
|
|
||||||
await expect(
|
|
||||||
restore('gradle', 'sub-project/**/build.gradle.kts')
|
|
||||||
).rejects.toThrow(
|
|
||||||
`No file in ${projectRoot(
|
|
||||||
workspace
|
|
||||||
)} matched to [sub-project/**/build.gradle.kts], make sure you have checked out the target repository`
|
|
||||||
);
|
|
||||||
});
|
|
||||||
it('downloads cache based on the specified pattern', async () => {
|
|
||||||
createFile(join(workspace, 'build.gradle.kts'));
|
|
||||||
createDirectory(join(workspace, 'sub-project1'));
|
|
||||||
createFile(join(workspace, 'sub-project1', 'build.gradle.kts'));
|
|
||||||
createDirectory(join(workspace, 'sub-project2'));
|
|
||||||
createFile(join(workspace, 'sub-project2', 'build.gradle.kts'));
|
|
||||||
|
|
||||||
await restore('gradle', 'build.gradle.kts');
|
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith('build.gradle.kts');
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
|
|
||||||
await restore('gradle', 'sub-project1/**/*.gradle*\n');
|
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
|
||||||
'sub-project1/**/*.gradle*'
|
|
||||||
);
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
|
|
||||||
await restore('gradle', '*.gradle*\nsub-project2/**/*.gradle*\n');
|
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
|
||||||
expect(spyGlobHashFiles).toHaveBeenCalledWith(
|
|
||||||
'*.gradle*\nsub-project2/**/*.gradle*'
|
|
||||||
);
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -263,16 +163,12 @@ describe('dependency cache', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyCacheSave = jest
|
spyCacheSave = jest
|
||||||
.spyOn(cache, 'saveCache')
|
.spyOn(cache, 'saveCache')
|
||||||
.mockImplementation((paths: string[], key: string) =>
|
.mockImplementation((paths: string[], key: string) => Promise.resolve(0));
|
||||||
Promise.resolve(0)
|
|
||||||
);
|
|
||||||
spyWarning.mockImplementation(() => null);
|
spyWarning.mockImplementation(() => null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws error if unsupported package manager specified', () => {
|
it('throws error if unsupported package manager specified', () => {
|
||||||
return expect(save('ant')).rejects.toThrow(
|
return expect(save('ant')).rejects.toThrowError('unknown package manager specified: ant');
|
||||||
'unknown package manager specified: ant'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('save with -1 cacheId , should not fail workflow', async () => {
|
it('save with -1 cacheId , should not fail workflow', async () => {
|
||||||
@ -280,12 +176,10 @@ describe('dependency cache', () => {
|
|||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
|
|
||||||
await save('maven');
|
await save('maven');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalled();
|
expect(spyInfo).toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('saves with error from toolkit, should fail workflow', async () => {
|
it('saves with error from toolkit, should fail workflow', async () => {
|
||||||
@ -295,37 +189,31 @@ describe('dependency cache', () => {
|
|||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
|
|
||||||
expect.assertions(1);
|
expect.assertions(1);
|
||||||
await expect(save('maven')).rejects.toEqual(
|
await expect(save('maven')).rejects.toEqual(new cache.ValidationError('Validation failed'));
|
||||||
new cache.ValidationError('Validation failed')
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('for maven', () => {
|
describe('for maven', () => {
|
||||||
it('uploads cache even if no pom.xml found', async () => {
|
it('uploads cache even if no pom.xml found', async () => {
|
||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
await save('maven');
|
await save('maven');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
});
|
});
|
||||||
it('does not upload cache if no restore run before', async () => {
|
it('does not upload cache if no restore run before', async () => {
|
||||||
createFile(join(workspace, 'pom.xml'));
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
|
||||||
await save('maven');
|
await save('maven');
|
||||||
expect(spyCacheSave).not.toHaveBeenCalled();
|
expect(spyCacheSave).not.toBeCalled();
|
||||||
expect(spyWarning).toHaveBeenCalledWith(
|
expect(spyWarning).toBeCalledWith('Error retrieving key from state.');
|
||||||
'Error retrieving key from state.'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache', async () => {
|
it('uploads cache', async () => {
|
||||||
createFile(join(workspace, 'pom.xml'));
|
createFile(join(workspace, 'pom.xml'));
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('maven');
|
await save('maven');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('for gradle', () => {
|
describe('for gradle', () => {
|
||||||
@ -333,39 +221,33 @@ describe('dependency cache', () => {
|
|||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
});
|
});
|
||||||
it('does not upload cache if no restore run before', async () => {
|
it('does not upload cache if no restore run before', async () => {
|
||||||
createFile(join(workspace, 'build.gradle'));
|
createFile(join(workspace, 'build.gradle'));
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).not.toHaveBeenCalled();
|
expect(spyCacheSave).not.toBeCalled();
|
||||||
expect(spyWarning).toHaveBeenCalledWith(
|
expect(spyWarning).toBeCalledWith('Error retrieving key from state.');
|
||||||
'Error retrieving key from state.'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache based on build.gradle', async () => {
|
it('uploads cache based on build.gradle', async () => {
|
||||||
createFile(join(workspace, 'build.gradle'));
|
createFile(join(workspace, 'build.gradle'));
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache based on build.gradle.kts', async () => {
|
it('uploads cache based on build.gradle.kts', async () => {
|
||||||
createFile(join(workspace, 'build.gradle.kts'));
|
createFile(join(workspace, 'build.gradle.kts'));
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache based on buildSrc/Versions.kt', async () => {
|
it('uploads cache based on buildSrc/Versions.kt', async () => {
|
||||||
createDirectory(join(workspace, 'buildSrc'));
|
createDirectory(join(workspace, 'buildSrc'));
|
||||||
@ -373,50 +255,33 @@ describe('dependency cache', () => {
|
|||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
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 () => {
|
||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
await save('sbt');
|
await save('sbt');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
});
|
});
|
||||||
it('does not upload cache if no restore run before', async () => {
|
it('does not upload cache if no restore run before', async () => {
|
||||||
createFile(join(workspace, 'build.sbt'));
|
createFile(join(workspace, 'build.sbt'));
|
||||||
|
|
||||||
await save('sbt');
|
await save('sbt');
|
||||||
expect(spyCacheSave).not.toHaveBeenCalled();
|
expect(spyCacheSave).not.toBeCalled();
|
||||||
expect(spyWarning).toHaveBeenCalledWith(
|
expect(spyWarning).toBeCalledWith('Error retrieving key from state.');
|
||||||
'Error retrieving key from state.'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache', async () => {
|
it('uploads cache', async () => {
|
||||||
createFile(join(workspace, 'build.sbt'));
|
createFile(join(workspace, 'build.sbt'));
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('sbt');
|
await save('sbt');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
it('uploads cache based on versions.properties', async () => {
|
|
||||||
createFile(join(workspace, 'versions.properties'));
|
|
||||||
createStateForSuccessfulRestore();
|
|
||||||
|
|
||||||
await save('gradle');
|
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
12
__tests__/cache/gradle2/.gitignore
vendored
12
__tests__/cache/gradle2/.gitignore
vendored
@ -1,12 +0,0 @@
|
|||||||
.gradle
|
|
||||||
**/build/
|
|
||||||
!src/**/build/
|
|
||||||
|
|
||||||
# Ignore Gradle GUI config
|
|
||||||
gradle-app.setting
|
|
||||||
|
|
||||||
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
|
|
||||||
!gradle-wrapper.jar
|
|
||||||
|
|
||||||
# Cache of project
|
|
||||||
.gradletasknamecache
|
|
17
__tests__/cache/gradle2/build.gradle
vendored
17
__tests__/cache/gradle2/build.gradle
vendored
@ -1,17 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'java'
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
implementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
|
|
||||||
}
|
|
||||||
tasks.register('downloadDependencies') {
|
|
||||||
doLast {
|
|
||||||
def total = configurations.compileClasspath.inject (0) { sum, file ->
|
|
||||||
sum + file.length()
|
|
||||||
}
|
|
||||||
println total
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,4 +1,4 @@
|
|||||||
import {run as cleanup} from '../src/cleanup-java';
|
import { run as cleanup } from '../src/cleanup-java';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as cache from '@actions/cache';
|
import * as cache from '@actions/cache';
|
||||||
import * as util from '../src/util';
|
import * as util from '../src/util';
|
||||||
@ -38,8 +38,8 @@ describe('cleanup', () => {
|
|||||||
return name === 'cache' ? 'gradle' : '';
|
return name === 'cache' ? 'gradle' : '';
|
||||||
});
|
});
|
||||||
await cleanup();
|
await cleanup();
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not fail even though the save process throws error', async () => {
|
it('does not fail even though the save process throws error', async () => {
|
||||||
@ -50,7 +50,7 @@ describe('cleanup', () => {
|
|||||||
return name === 'cache' ? 'gradle' : '';
|
return name === 'cache' ? 'gradle' : '';
|
||||||
});
|
});
|
||||||
await cleanup();
|
await cleanup();
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,443 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"buildVersion": 36,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14+36/bellsoft-jdk14+36-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "14+36",
|
|
||||||
"featureVersion": 14
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 11,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.11+9/bellsoft-jdk11.0.11+9-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.11+9",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14.0.1+8/bellsoft-jdk14.0.1+8-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "14.0.1+8",
|
|
||||||
"featureVersion": 14
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 262,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u262+10/bellsoft-jdk8u262+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u262+10",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 1,
|
|
||||||
"updateVersion": 275,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u275+1/bellsoft-jdk8u275+1-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u275+1",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 1,
|
|
||||||
"updateVersion": 9,
|
|
||||||
"patchVersion": 1,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9.1+1/bellsoft-jdk11.0.9.1+1-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.9.1+1",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 202,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u202/bellsoft-jdk8u202-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u202+8",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 33,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12/bellsoft-jdk12-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "12+33",
|
|
||||||
"featureVersion": 12
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 282,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u282+8/bellsoft-jdk8u282+8-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u282+8",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 11,
|
|
||||||
"updateVersion": 9,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9+11/bellsoft-jdk11.0.9+11-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.9+11",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 33,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13/bellsoft-jdk13-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "13+33",
|
|
||||||
"featureVersion": 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 9,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9+12/bellsoft-jdk11.0.9+12-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.9+12",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 7,
|
|
||||||
"updateVersion": 242,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u242+7/bellsoft-jdk8u242+7-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u242+7",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.2+9/bellsoft-jdk13.0.2+9-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "13.0.2+9",
|
|
||||||
"featureVersion": 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.1/bellsoft-jdk13.0.1-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "13.0.1+9",
|
|
||||||
"featureVersion": 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 1,
|
|
||||||
"updateVersion": 265,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u265+1/bellsoft-jdk8u265+1-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u265+1",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.1+9/bellsoft-jdk15.0.1+9-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "15.0.1+9",
|
|
||||||
"featureVersion": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 272,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u272+10/bellsoft-jdk8u272+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u272+10",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 7,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16.0.2+7/bellsoft-jdk16.0.2+7-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "16.0.2+7",
|
|
||||||
"featureVersion": 16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 6,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.6+10/bellsoft-jdk11.0.6+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.6+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 252,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u252+9/bellsoft-jdk8u252+9-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u252+9",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 212,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u212/bellsoft-jdk8u212-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u212+12",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.2+10/bellsoft-jdk15.0.2+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "15.0.2+10",
|
|
||||||
"featureVersion": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 10,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.10+9/bellsoft-jdk11.0.10+9-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.10+9",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 0,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.1/bellsoft-jdk11.0.1-linux-amd64.tar.gz",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.1+0",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 7,
|
|
||||||
"updateVersion": 12,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.12+7/bellsoft-jdk11.0.12+7-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.12+7",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 36,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16+36/bellsoft-jdk16+36-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "16+36",
|
|
||||||
"featureVersion": 16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 3,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.3/bellsoft-jdk11.0.3-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.3+12",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 8,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.8+10/bellsoft-jdk11.0.8+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.8+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 7,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.2/bellsoft-jdk11.0.2-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.2+7",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 5,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5/bellsoft-jdk11.0.5-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.5+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 4,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.4/bellsoft-jdk11.0.4-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.4+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12.0.2/bellsoft-jdk12.0.2-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "12.0.2+10",
|
|
||||||
"featureVersion": 12
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12.0.1/bellsoft-jdk12.0.1-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "12.0.1+12",
|
|
||||||
"featureVersion": 12
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.1+10/bellsoft-jdk13.0.1+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "13.0.1+10",
|
|
||||||
"featureVersion": 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 11,
|
|
||||||
"updateVersion": 5,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-linux-amd64.tar.gz",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.5+11",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 11,
|
|
||||||
"updateVersion": 5,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.5+11",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 292,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u292+10/bellsoft-jdk8u292+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u292+10",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 11,
|
|
||||||
"updateVersion": 222,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u222/bellsoft-jdk8u222-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u222+11",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 36,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15+36/bellsoft-jdk15+36-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "15+36",
|
|
||||||
"featureVersion": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 7,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.7+10/bellsoft-jdk11.0.7+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.7+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 232,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u232+10/bellsoft-jdk8u232+10-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u232+10",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.2+8/bellsoft-jdk15.0.2+8-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "15.0.2+8",
|
|
||||||
"featureVersion": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 302,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u302+8/bellsoft-jdk8u302+8-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u302+8",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 192,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u192.all/bellsoft-jdk1.8.0-linux-amd64.tar.gz",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u192+12",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 13,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14.0.2+13/bellsoft-jdk14.0.2+13-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "14.0.2+13",
|
|
||||||
"featureVersion": 14
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16.0.1+9/bellsoft-jdk16.0.1+9-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "16.0.1+9",
|
|
||||||
"featureVersion": 16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 232,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u232/bellsoft-jdk8u232-linux-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u232+9",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 13,
|
|
||||||
"updateVersion": 10,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl":"https://download.bell-sw.com/java/17.0.10+13/bellsoft-jdk17.0.10+13-linux-amd64.tar.gz",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "17.0.10+13",
|
|
||||||
"featureVersion": 17
|
|
||||||
}
|
|
||||||
]
|
|
@ -1,452 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"buildVersion": 36,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14+36/bellsoft-jdk14+36-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "14+36",
|
|
||||||
"featureVersion": 14
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 11,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.11+9/bellsoft-jdk11.0.11+9-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.11+9",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14.0.1+8/bellsoft-jdk14.0.1+8-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "14.0.1+8",
|
|
||||||
"featureVersion": 14
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 262,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u262+10/bellsoft-jdk8u262+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u262+10",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 1,
|
|
||||||
"updateVersion": 275,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u275+1/bellsoft-jdk8u275+1-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u275+1",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 1,
|
|
||||||
"updateVersion": 9,
|
|
||||||
"patchVersion": 1,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9.1+1/bellsoft-jdk11.0.9.1+1-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.9.1+1",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 202,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u202/bellsoft-jdk8u202-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u202+8",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 33,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12/bellsoft-jdk12-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "12+33",
|
|
||||||
"featureVersion": 12
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 282,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u282+8/bellsoft-jdk8u282+8-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u282+8",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 11,
|
|
||||||
"updateVersion": 9,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9+11/bellsoft-jdk11.0.9+11-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.9+11",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 33,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13/bellsoft-jdk13-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "13+33",
|
|
||||||
"featureVersion": 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 9,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9+12/bellsoft-jdk11.0.9+12-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.9+12",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 7,
|
|
||||||
"updateVersion": 242,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u242+7/bellsoft-jdk8u242+7-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u242+7",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.2+9/bellsoft-jdk13.0.2+9-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "13.0.2+9",
|
|
||||||
"featureVersion": 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.1/bellsoft-jdk13.0.1-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "13.0.1+9",
|
|
||||||
"featureVersion": 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 1,
|
|
||||||
"updateVersion": 265,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u265+1/bellsoft-jdk8u265+1-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u265+1",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.1+9/bellsoft-jdk15.0.1+9-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "15.0.1+9",
|
|
||||||
"featureVersion": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 272,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u272+10/bellsoft-jdk8u272+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u272+10",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 7,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16.0.2+7/bellsoft-jdk16.0.2+7-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "16.0.2+7",
|
|
||||||
"featureVersion": 16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 6,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.6+10/bellsoft-jdk11.0.6+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.6+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 252,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u252+9/bellsoft-jdk8u252+9-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u252+9",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 212,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u212/bellsoft-jdk8u212-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u212+12",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.2+10/bellsoft-jdk15.0.2+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "15.0.2+10",
|
|
||||||
"featureVersion": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 10,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.10+9/bellsoft-jdk11.0.10+9-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.10+9",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 0,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.1/bellsoft-jdk11.0.1-windows-amd64.tar.gz",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.1+0",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 7,
|
|
||||||
"updateVersion": 12,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.12+7/bellsoft-jdk11.0.12+7-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.12+7",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 36,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16+36/bellsoft-jdk16+36-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "16+36",
|
|
||||||
"featureVersion": 16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 3,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.3/bellsoft-jdk11.0.3-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.3+12",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 8,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.8+10/bellsoft-jdk11.0.8+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.8+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 7,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.2/bellsoft-jdk11.0.2-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.2+7",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 5,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5/bellsoft-jdk11.0.5-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.5+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 4,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.4/bellsoft-jdk11.0.4-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.4+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12.0.2/bellsoft-jdk12.0.2-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "12.0.2+10",
|
|
||||||
"featureVersion": 12
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12.0.1/bellsoft-jdk12.0.1-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "12.0.1+12",
|
|
||||||
"featureVersion": 12
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.1+10/bellsoft-jdk13.0.1+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "13.0.1+10",
|
|
||||||
"featureVersion": 13
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 11,
|
|
||||||
"updateVersion": 5,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-windows-amd64.tar.gz",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.5+11",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 11,
|
|
||||||
"updateVersion": 5,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.5+11",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 292,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u292+10/bellsoft-jdk8u292+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u292+10",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 11,
|
|
||||||
"updateVersion": 222,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u222/bellsoft-jdk8u222-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u222+11",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 36,
|
|
||||||
"updateVersion": 0,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15+36/bellsoft-jdk15+36-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "15+36",
|
|
||||||
"featureVersion": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 7,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.7+10/bellsoft-jdk11.0.7+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "11.0.7+10",
|
|
||||||
"featureVersion": 11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 10,
|
|
||||||
"updateVersion": 232,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u232+10/bellsoft-jdk8u232+10-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u232+10",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.2+8/bellsoft-jdk15.0.2+8-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "15.0.2+8",
|
|
||||||
"featureVersion": 15
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 8,
|
|
||||||
"updateVersion": 302,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u302+8/bellsoft-jdk8u302+8-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u302+8",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 12,
|
|
||||||
"updateVersion": 192,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u192.all/bellsoft-jdk1.8.0-windows-amd64.tar.gz",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u192+12",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 13,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14.0.2+13/bellsoft-jdk14.0.2+13-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "14.0.2+13",
|
|
||||||
"featureVersion": 14
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 1,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16.0.1+9/bellsoft-jdk16.0.1+9-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "16.0.1+9",
|
|
||||||
"featureVersion": 16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 9,
|
|
||||||
"updateVersion": 232,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u232/bellsoft-jdk8u232-windows-amd64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "8u232+9",
|
|
||||||
"featureVersion": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 14,
|
|
||||||
"updateVersion": 2,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://download.bell-sw.com/java/21.0.2+14/bellsoft-jdk21.0.2+14-windows-aarch64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "21.0.2+14",
|
|
||||||
"featureVersion": 21
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"buildVersion": 13,
|
|
||||||
"updateVersion": 10,
|
|
||||||
"patchVersion": 0,
|
|
||||||
"downloadUrl": "https://download.bell-sw.com/java/17.0.10+13/bellsoft-jdk17.0.10+13-windows-aarch64.zip",
|
|
||||||
"interimVersion": 0,
|
|
||||||
"version": "17.0.10+13",
|
|
||||||
"featureVersion": 17
|
|
||||||
}
|
|
||||||
]
|
|
@ -1,261 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"version": "21.0.0",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.0-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.0-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.0-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.0-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-21.0.0-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "17.0.7",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-windows-aarch64.zip",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-windows-aarch64.zip"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "17.0.1+12.1",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "16.0.2+7.1",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.19",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.15",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.13+8.1",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.13.8.1-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,254 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 1, 0, 10],
|
|
||||||
"jdk_version": [8, 0, 5, 13]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 2, 0, 1],
|
|
||||||
"jdk_version": [8, 0, 11, 12]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 21, 0, 1],
|
|
||||||
"jdk_version": [8, 0, 131, 11]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 23, 0, 3],
|
|
||||||
"jdk_version": [8, 0, 144, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 25, 0, 1],
|
|
||||||
"jdk_version": [8, 0, 152, 16]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 46, 0, 19],
|
|
||||||
"jdk_version": [8, 0, 252, 14]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 48, 0, 47],
|
|
||||||
"jdk_version": [8, 0, 262, 17]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 48, 0, 51],
|
|
||||||
"jdk_version": [8, 0, 262, 19]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 48, 0, 49],
|
|
||||||
"jdk_version": [8, 0, 262, 18]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 52, 0, 23],
|
|
||||||
"jdk_version": [8, 0, 282, 8]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [9, 0, 0, 15],
|
|
||||||
"jdk_version": [9, 0, 0, 0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [9, 0, 1, 3],
|
|
||||||
"jdk_version": [9, 0, 1, 0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [10, 2, 3, 0],
|
|
||||||
"jdk_version": [10, 0, 1, 9]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [10, 3, 5, 0],
|
|
||||||
"jdk_version": [10, 0, 2, 13]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 2, 3, 0],
|
|
||||||
"jdk_version": [11, 0, 1, 13]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 29, 3, 0],
|
|
||||||
"jdk_version": [11, 0, 2, 7]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 31, 11, 0],
|
|
||||||
"jdk_version": [11, 0, 3, 7]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 35, 13, 0],
|
|
||||||
"jdk_version": [11, 0, 5, 10]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 35, 15, 0],
|
|
||||||
"jdk_version": [11, 0, 5, 10]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 35, 11, 0],
|
|
||||||
"jdk_version": [11, 0, 5, 10]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 45, 27, 0],
|
|
||||||
"jdk_version": [11, 0, 10, 9]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [12, 1, 3, 0],
|
|
||||||
"jdk_version": [12, 0, 0, 33]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [12, 2, 3, 0],
|
|
||||||
"jdk_version": [12, 0, 1, 12]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [12, 3, 11, 0],
|
|
||||||
"jdk_version": [12, 0, 2, 3]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [13, 27, 9, 0],
|
|
||||||
"jdk_version": [13, 0, 0, 33]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [13, 28, 11, 0],
|
|
||||||
"jdk_version": [13, 0, 1, 10]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [13, 29, 9, 0],
|
|
||||||
"jdk_version": [13, 0, 2, 6]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [13, 37, 21, 0],
|
|
||||||
"jdk_version": [13, 0, 6, 5]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [14, 27, 1, 0],
|
|
||||||
"jdk_version": [14, 0, 0, 36]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [14, 28, 21, 0],
|
|
||||||
"jdk_version": [14, 0, 1, 8]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [14, 29, 23, 0],
|
|
||||||
"jdk_version": [14, 0, 2, 12]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [15, 27, 17, 0],
|
|
||||||
"jdk_version": [15, 0, 0, 36]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [15, 28, 13, 0],
|
|
||||||
"jdk_version": [15, 0, 1, 8]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [15, 28, 51, 0],
|
|
||||||
"jdk_version": [15, 0, 1, 9]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [15, 29, 15, 0],
|
|
||||||
"jdk_version": [15, 0, 2, 7]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [21, 32, 17, 0],
|
|
||||||
"jdk_version": [21, 0, 2, 6]
|
|
||||||
}
|
|
||||||
]
|
|
@ -1,254 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 1, 0, 10],
|
|
||||||
"jdk_version": [8, 0, 5, 13]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 2, 0, 1],
|
|
||||||
"jdk_version": [8, 0, 11, 12]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 21, 0, 1],
|
|
||||||
"jdk_version": [8, 0, 131, 11]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 23, 0, 3],
|
|
||||||
"jdk_version": [8, 0, 144, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 25, 0, 1],
|
|
||||||
"jdk_version": [8, 0, 152, 16]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 46, 0, 19],
|
|
||||||
"jdk_version": [8, 0, 252, 14]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 48, 0, 47],
|
|
||||||
"jdk_version": [8, 0, 262, 17]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 48, 0, 51],
|
|
||||||
"jdk_version": [8, 0, 262, 19]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 48, 0, 49],
|
|
||||||
"jdk_version": [8, 0, 262, 18]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [8, 52, 0, 23],
|
|
||||||
"jdk_version": [8, 0, 282, 8]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [9, 0, 0, 15],
|
|
||||||
"jdk_version": [9, 0, 0, 0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [9, 0, 1, 3],
|
|
||||||
"jdk_version": [9, 0, 1, 0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [10, 2, 3, 0],
|
|
||||||
"jdk_version": [10, 0, 1, 9]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [10, 3, 5, 0],
|
|
||||||
"jdk_version": [10, 0, 2, 13]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 2, 3, 0],
|
|
||||||
"jdk_version": [11, 0, 1, 13]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 29, 3, 0],
|
|
||||||
"jdk_version": [11, 0, 2, 7]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 31, 11, 0],
|
|
||||||
"jdk_version": [11, 0, 3, 7]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 35, 13, 0],
|
|
||||||
"jdk_version": [11, 0, 5, 10]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 35, 15, 0],
|
|
||||||
"jdk_version": [11, 0, 5, 10]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 35, 11, 0],
|
|
||||||
"jdk_version": [11, 0, 5, 10]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [11, 45, 27, 0],
|
|
||||||
"jdk_version": [11, 0, 10, 9]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [12, 1, 3, 0],
|
|
||||||
"jdk_version": [12, 0, 0, 33]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [12, 2, 3, 0],
|
|
||||||
"jdk_version": [12, 0, 1, 12]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [12, 3, 11, 0],
|
|
||||||
"jdk_version": [12, 0, 2, 3]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [13, 27, 9, 0],
|
|
||||||
"jdk_version": [13, 0, 0, 33]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [13, 28, 11, 0],
|
|
||||||
"jdk_version": [13, 0, 1, 10]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [13, 29, 9, 0],
|
|
||||||
"jdk_version": [13, 0, 2, 6]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [13, 37, 21, 0],
|
|
||||||
"jdk_version": [13, 0, 6, 5]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [14, 27, 1, 0],
|
|
||||||
"jdk_version": [14, 0, 0, 36]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [14, 28, 21, 0],
|
|
||||||
"jdk_version": [14, 0, 1, 8]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [14, 29, 23, 0],
|
|
||||||
"jdk_version": [14, 0, 2, 12]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [15, 27, 17, 0],
|
|
||||||
"jdk_version": [15, 0, 0, 36]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [15, 28, 13, 0],
|
|
||||||
"jdk_version": [15, 0, 1, 8]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [15, 28, 51, 0],
|
|
||||||
"jdk_version": [15, 0, 1, 9]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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",
|
|
||||||
"zulu_version": [15, 29, 15, 0],
|
|
||||||
"jdk_version": [15, 0, 2, 7]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 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_aarhc4.zip",
|
|
||||||
"zulu_version": [17, 48, 15, 0],
|
|
||||||
"jdk_version": [17, 0, 10, 7]
|
|
||||||
}
|
|
||||||
]
|
|
@ -1,14 +1,11 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
import { HttpClient } from '@actions/http-client';
|
||||||
import {IAdoptAvailableVersions} from '../../src/distributions/adopt/models';
|
|
||||||
import {
|
import { AdoptDistribution, AdoptImplementation } from '../../src/distributions/adopt/installer';
|
||||||
AdoptDistribution,
|
import { JavaInstallerOptions } from '../../src/distributions/base-models';
|
||||||
AdoptImplementation
|
|
||||||
} from '../../src/distributions/adopt/installer';
|
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
|
||||||
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import manifestData from '../data/adopt.json';
|
let manifestData = require('../data/adopt.json') as [];
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: jest.SpyInstance;
|
||||||
@ -30,82 +27,42 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11-ea', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.OpenJ9,
|
AdoptImplementation.OpenJ9,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.OpenJ9,
|
AdoptImplementation.OpenJ9,
|
||||||
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.OpenJ9,
|
AdoptImplementation.OpenJ9,
|
||||||
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11-ea', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.OpenJ9,
|
AdoptImplementation.OpenJ9,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=openj9&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=openj9&page_size=20&page=0'
|
||||||
]
|
]
|
||||||
@ -117,8 +74,7 @@ describe('getAvailableVersions', () => {
|
|||||||
expectedParameters
|
expectedParameters
|
||||||
) => {
|
) => {
|
||||||
const distribution = new AdoptDistribution(installerOptions, impl);
|
const distribution = new AdoptDistribution(installerOptions, impl);
|
||||||
const baseUrl =
|
const baseUrl = 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
||||||
'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
|
||||||
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
||||||
distribution['getPlatformOption'] = () => 'mac';
|
distribution['getPlatformOption'] = () => 'mac';
|
||||||
|
|
||||||
@ -135,12 +91,12 @@ describe('getAvailableVersions', () => {
|
|||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as any
|
result: manifestData
|
||||||
})
|
})
|
||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as any
|
result: manifestData
|
||||||
})
|
})
|
||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
@ -149,12 +105,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
const availableVersions = await distribution['getAvailableVersions']();
|
||||||
@ -171,12 +122,7 @@ describe('getAvailableVersions', () => {
|
|||||||
'find right toolchain folder',
|
'find right toolchain folder',
|
||||||
(impl: AdoptImplementation, packageType: string, expected: string) => {
|
(impl: AdoptImplementation, packageType: string, expected: string) => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: packageType, checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
impl
|
impl
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -202,12 +148,8 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
const expectedParameters = `os=mac&architecture=${distroArch}&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0`;
|
const expectedParameters = `os=mac&architecture=${distroArch}&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0`;
|
||||||
|
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(installerOptions, AdoptImplementation.Hotspot);
|
||||||
installerOptions,
|
const baseUrl = 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
||||||
AdoptImplementation.Hotspot
|
|
||||||
);
|
|
||||||
const baseUrl =
|
|
||||||
'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
|
||||||
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
||||||
distribution['getPlatformOption'] = () => 'mac';
|
distribution['getPlatformOption'] = () => 'mac';
|
||||||
|
|
||||||
@ -234,63 +176,43 @@ describe('findPackageForDownload', () => {
|
|||||||
['15.0.1+9.1', '15.0.1+9.1']
|
['15.0.1+9.1', '15.0.1+9.1']
|
||||||
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
||||||
expect(resolvedVersion.version).toBe(expected);
|
expect(resolvedVersion.version).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version is found but binaries list is empty', async () => {
|
it('version is found but binaries list is empty', async () => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload']('9.0.8')).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload']('9.0.8')
|
/Could not find satisfied version for SemVer */
|
||||||
).rejects.toThrow(/Could not find satisfied version for SemVer */);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version is not found', async () => {
|
it('version is not found', async () => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrowError(
|
||||||
/Could not find satisfied version for SemVer */
|
/Could not find satisfied version for SemVer */
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version list is empty', async () => {
|
it('version list is empty', async () => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => [];
|
distribution['getAvailableVersions'] = async () => [];
|
||||||
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('11')).rejects.toThrowError(
|
||||||
/Could not find satisfied version for SemVer */
|
/Could not find satisfied version for SemVer */
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -5,7 +5,7 @@ import * as util from '../../src/util';
|
|||||||
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 { JavaBase } from '../../src/distributions/base-installer';
|
||||||
import {
|
import {
|
||||||
JavaDownloadRelease,
|
JavaDownloadRelease,
|
||||||
JavaInstallerOptions,
|
JavaInstallerOptions,
|
||||||
@ -19,23 +19,14 @@ class EmptyJavaBase extends JavaBase {
|
|||||||
super('Empty', installerOptions);
|
super('Empty', installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
return {
|
return {
|
||||||
version: '11.0.9',
|
version: '11.0.9',
|
||||||
path: path.join(
|
path: path.join('toolcache', this.toolcacheFolderName, '11.0.9', this.architecture)
|
||||||
'toolcache',
|
|
||||||
this.toolcacheFolderName,
|
|
||||||
'11.0.9',
|
|
||||||
this.architecture
|
|
||||||
)
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
|
||||||
range: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const availableVersion = '11.0.9';
|
const availableVersion = '11.0.9';
|
||||||
if (!semver.satisfies(availableVersion, range)) {
|
if (!semver.satisfies(availableVersion, range)) {
|
||||||
throw new Error('Available version not found');
|
throw new Error('Available version not found');
|
||||||
@ -69,111 +60,44 @@ describe('findInToolcache', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.8', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0.8',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0', architecture: 'x64', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.8', architecture: 'x64', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0.8',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[{ version: '11', architecture: 'x64', packageType: 'jre', checkLatest: false }, null],
|
||||||
{
|
[{ version: '8', architecture: 'x64', packageType: 'jdk', checkLatest: false }, null],
|
||||||
version: '11',
|
[{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false }, null],
|
||||||
architecture: 'x64',
|
[{ version: '11', architecture: 'x86', packageType: 'jre', checkLatest: false }, null]
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
null
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
null
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
null
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
null
|
|
||||||
]
|
|
||||||
])(`should find java for path %s -> %s`, (input, expected) => {
|
])(`should find java for path %s -> %s`, (input, expected) => {
|
||||||
spyTcFindAllVersions.mockReturnValue([actualJavaVersion]);
|
spyTcFindAllVersions.mockReturnValue([actualJavaVersion]);
|
||||||
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);
|
||||||
|
|
||||||
if (
|
if (path.basename(javaPath) !== architecture || !javaPath.includes(toolname)) {
|
||||||
path.basename(javaPath) !== architecture ||
|
|
||||||
!javaPath.includes(toolname)
|
|
||||||
) {
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return semver.satisfies(actualJavaVersion, semverVersion)
|
return semver.satisfies(actualJavaVersion, semverVersion) ? javaPath : '';
|
||||||
? javaPath
|
|
||||||
: '';
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
@ -181,63 +105,52 @@ describe('findInToolcache', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['11', {version: '11.0.3+2', versionInPath: '11.0.3-2'}],
|
['11', { version: '11.0.3+2', versionInPath: '11.0.3-2' }],
|
||||||
['11.0', {version: '11.0.3+2', versionInPath: '11.0.3-2'}],
|
['11.0', { version: '11.0.3+2', versionInPath: '11.0.3-2' }],
|
||||||
['11.0.1', {version: '11.0.1', versionInPath: '11.0.1'}],
|
['11.0.1', { version: '11.0.1', versionInPath: '11.0.1' }],
|
||||||
['11.0.3', {version: '11.0.3+2', versionInPath: '11.0.3-2'}],
|
['11.0.3', { version: '11.0.3+2', versionInPath: '11.0.3-2' }],
|
||||||
['15', {version: '15.0.2+4', versionInPath: '15.0.2-4'}],
|
['15', { version: '15.0.2+4', versionInPath: '15.0.2-4' }],
|
||||||
['x', {version: '15.0.2+4', versionInPath: '15.0.2-4'}],
|
['x', { version: '15.0.2+4', versionInPath: '15.0.2-4' }],
|
||||||
['x-ea', {version: '17.4.4', versionInPath: '17.4.4-ea'}],
|
['x-ea', { version: '17.4.4', versionInPath: '17.4.4-ea' }],
|
||||||
[
|
['11-ea', { version: '11.3.3+5.2.1231421', versionInPath: '11.3.3-ea.5.2.1231421' }],
|
||||||
'11-ea',
|
['11.2-ea', { version: '11.2.1', versionInPath: '11.2.1-ea' }],
|
||||||
{version: '11.3.3+5.2.1231421', versionInPath: '11.3.3-ea.5.2.1231421'}
|
['11.2.1-ea', { version: '11.2.1', versionInPath: '11.2.1-ea' }]
|
||||||
],
|
])('should choose correct java from tool-cache for input %s', (input, expected) => {
|
||||||
['11.2-ea', {version: '11.2.1', versionInPath: '11.2.1-ea'}],
|
spyTcFindAllVersions.mockReturnValue([
|
||||||
['11.2.1-ea', {version: '11.2.1', versionInPath: '11.2.1-ea'}]
|
'17.4.4-ea',
|
||||||
])(
|
'11.0.2',
|
||||||
'should choose correct java from tool-cache for input %s',
|
'15.0.2-4',
|
||||||
(input, expected) => {
|
'11.0.3-2',
|
||||||
spyTcFindAllVersions.mockReturnValue([
|
'11.2.1-ea',
|
||||||
'17.4.4-ea',
|
'11.3.2-ea',
|
||||||
'11.0.2',
|
'11.3.2-ea.5',
|
||||||
'15.0.2-4',
|
'11.3.3-ea.5.2.1231421',
|
||||||
'11.0.3-2',
|
'12.3.2-0',
|
||||||
'11.2.1-ea',
|
'11.0.1'
|
||||||
'11.3.2-ea',
|
]);
|
||||||
'11.3.2-ea.5',
|
spyGetToolcachePath.mockImplementation(
|
||||||
'11.3.3-ea.5.2.1231421',
|
(toolname: string, javaVersion: string, architecture: string) =>
|
||||||
'12.3.2-0',
|
`/hostedtoolcache/${toolname}/${javaVersion}/${architecture}`
|
||||||
'11.0.1'
|
);
|
||||||
]);
|
mockJavaBase = new EmptyJavaBase({
|
||||||
spyGetToolcachePath.mockImplementation(
|
version: input,
|
||||||
(toolname: string, javaVersion: string, architecture: string) =>
|
architecture: 'x64',
|
||||||
`/hostedtoolcache/${toolname}/${javaVersion}/${architecture}`
|
packageType: 'jdk',
|
||||||
);
|
checkLatest: false
|
||||||
mockJavaBase = new EmptyJavaBase({
|
});
|
||||||
version: input,
|
const foundVersion = mockJavaBase['findInToolcache']();
|
||||||
architecture: 'x64',
|
expect(foundVersion).toEqual({
|
||||||
packageType: 'jdk',
|
version: expected.version,
|
||||||
checkLatest: false
|
path: `/hostedtoolcache/Java_Empty_jdk/${expected.versionInPath}/x64`
|
||||||
});
|
});
|
||||||
const foundVersion = mockJavaBase['findInToolcache']();
|
});
|
||||||
expect(foundVersion).toEqual({
|
|
||||||
version: expected.version,
|
|
||||||
path: `/hostedtoolcache/Java_Empty_jdk/${expected.versionInPath}/x64`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('setupJava', () => {
|
describe('setupJava', () => {
|
||||||
const actualJavaVersion = '11.0.9';
|
const actualJavaVersion = '11.0.9';
|
||||||
const installedJavaVersion = '11.0.8';
|
const installedJavaVersion = '11.0.8';
|
||||||
const javaPath = path.join('Java_Empty_jdk', installedJavaVersion, 'x86');
|
const javaPath = path.join('Java_Empty_jdk', installedJavaVersion, 'x86');
|
||||||
const javaPathInstalled = path.join(
|
const javaPathInstalled = path.join('toolcache', 'Java_Empty_jdk', actualJavaVersion, 'x86');
|
||||||
'toolcache',
|
|
||||||
'Java_Empty_jdk',
|
|
||||||
actualJavaVersion,
|
|
||||||
'x86'
|
|
||||||
);
|
|
||||||
|
|
||||||
let mockJavaBase: EmptyJavaBase;
|
let mockJavaBase: EmptyJavaBase;
|
||||||
|
|
||||||
@ -255,16 +168,11 @@ describe('setupJava', () => {
|
|||||||
(toolname: string, javaVersion: string, architecture: string) => {
|
(toolname: string, javaVersion: string, architecture: string) => {
|
||||||
const semverVersion = new semver.Range(javaVersion);
|
const semverVersion = new semver.Range(javaVersion);
|
||||||
|
|
||||||
if (
|
if (path.basename(javaPath) !== architecture || !javaPath.includes(toolname)) {
|
||||||
path.basename(javaPath) !== architecture ||
|
|
||||||
!javaPath.includes(toolname)
|
|
||||||
) {
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return semver.satisfies(installedJavaVersion, semverVersion)
|
return semver.satisfies(installedJavaVersion, semverVersion) ? javaPath : '';
|
||||||
? javaPath
|
|
||||||
: '';
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -298,46 +206,27 @@ describe('setupJava', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
{ version: installedJavaVersion, path: javaPath }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: installedJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0',
|
{ version: installedJavaVersion, path: javaPath }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: installedJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.8', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0.8',
|
{ version: installedJavaVersion, path: javaPath }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: installedJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{version: '11', architecture: '', packageType: 'jdk', checkLatest: false},
|
{ version: '11', architecture: '', packageType: 'jdk', checkLatest: false },
|
||||||
{version: installedJavaVersion, path: javaPath}
|
{ version: installedJavaVersion, path: javaPath }
|
||||||
]
|
]
|
||||||
])('should find java locally for %s', async (input, expected) => {
|
])('should find java locally for %s', (input, expected) => {
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
expect(spyGetToolcachePath).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${expected.version} from tool-cache`);
|
||||||
`Resolved Java ${expected.version} from tool-cache`
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Setting Java ${expected.version} as the default`);
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Setting Java ${expected.version} as the default`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
'Trying to resolve the latest version from remote'
|
'Trying to resolve the latest version from remote'
|
||||||
);
|
);
|
||||||
@ -346,47 +235,20 @@ describe('setupJava', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jre', checkLatest: false },
|
||||||
version: '11',
|
{ path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x86'), version: '11.0.9' }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x86'),
|
|
||||||
version: '11.0.9'
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
{ path: path.join('toolcache', 'Java_Empty_jdk', '11.0.9', 'x64'), version: '11.0.9' }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: path.join('toolcache', 'Java_Empty_jdk', '11.0.9', 'x64'),
|
|
||||||
version: '11.0.9'
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '11',
|
{ path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x64'), version: '11.0.9' }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x64'),
|
|
||||||
version: '11.0.9'
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{version: '11', architecture: '', packageType: 'jre', checkLatest: false},
|
{ version: '11', architecture: '', packageType: 'jre', checkLatest: false },
|
||||||
{
|
{ path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x86'), version: '11.0.9' }
|
||||||
path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x86'),
|
|
||||||
version: '11.0.9'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
])('download java with configuration %s', async (input, expected) => {
|
])('download java with configuration %s', async (input, expected) => {
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
@ -395,176 +257,93 @@ describe('setupJava', () => {
|
|||||||
expect(spyCoreAddPath).toHaveBeenCalled();
|
expect(spyCoreAddPath).toHaveBeenCalled();
|
||||||
expect(spyCoreExportVariable).toHaveBeenCalled();
|
expect(spyCoreExportVariable).toHaveBeenCalled();
|
||||||
expect(spyCoreExportVariable).toHaveBeenCalledWith(
|
expect(spyCoreExportVariable).toHaveBeenCalledWith(
|
||||||
`JAVA_HOME_${input.version}_${(
|
`JAVA_HOME_${input.version}_${(input.architecture || 'x86').toLocaleUpperCase()}`,
|
||||||
input.architecture || 'x86'
|
|
||||||
).toLocaleUpperCase()}`,
|
|
||||||
expected.path
|
expected.path
|
||||||
);
|
);
|
||||||
expect(spyCoreSetOutput).toHaveBeenCalled();
|
expect(spyCoreSetOutput).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to resolve the latest version from remote');
|
||||||
'Trying to resolve the latest version from remote'
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved latest version as ${expected.version}`);
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Resolved latest version as ${expected.version}`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Java ${expected.version} was downloaded`);
|
||||||
`Java ${expected.version} was downloaded`
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Setting Java ${expected.version} as the default`);
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Setting Java ${expected.version} as the default`
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.9', architecture: 'x86', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0.9',
|
{ version: '11.0.9', path: javaPathInstalled }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: '11.0.9', path: javaPathInstalled}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.9', architecture: '', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0.9',
|
{ version: '11.0.9', path: javaPathInstalled }
|
||||||
architecture: '',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: '11.0.9', path: javaPathInstalled}
|
|
||||||
]
|
]
|
||||||
])(
|
])('should check the latest java version for %s and resolve locally', async (input, expected) => {
|
||||||
'should check the latest java version for %s and resolve locally',
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
async (input, expected) => {
|
mockJavaBase['findInToolcache'] = () => ({ version: '11.0.9', path: expected.path });
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
mockJavaBase['findInToolcache'] = () => ({
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to resolve the latest version from remote');
|
||||||
version: '11.0.9',
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved latest version as ${expected.version}`);
|
||||||
path: expected.path
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${expected.version} from tool-cache`);
|
||||||
});
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Setting Java ${expected.version} as the default`);
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
});
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
'Trying to resolve the latest version from remote'
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Resolved latest version as ${expected.version}`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Resolved Java ${expected.version} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Setting Java ${expected.version} as the default`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11',
|
{ version: actualJavaVersion, path: javaPathInstalled }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPathInstalled}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0', architecture: 'x86', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0',
|
{ version: actualJavaVersion, path: javaPathInstalled }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPathInstalled}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.x', architecture: 'x86', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0.x',
|
{ version: actualJavaVersion, path: javaPathInstalled }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPathInstalled}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{version: '11', architecture: '', packageType: 'jdk', checkLatest: true},
|
{ version: '11', architecture: '', packageType: 'jdk', checkLatest: true },
|
||||||
{version: actualJavaVersion, path: javaPathInstalled}
|
{ version: actualJavaVersion, path: javaPathInstalled }
|
||||||
]
|
]
|
||||||
])(
|
])('should check the latest java version for %s and download', async (input, expected) => {
|
||||||
'should check the latest java version for %s and download',
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
async (input, expected) => {
|
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
expect(spyGetToolcachePath).toHaveBeenCalled();
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to resolve the latest version from remote');
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved latest version as ${actualJavaVersion}`);
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
||||||
'Trying to resolve the latest version from remote'
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Java ${actualJavaVersion} was downloaded`);
|
||||||
);
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Setting Java ${expected.version} as the default`);
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
});
|
||||||
`Resolved latest version as ${actualJavaVersion}`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Java ${actualJavaVersion} was downloaded`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Setting Java ${expected.version} as the default`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[{ version: '15', architecture: 'x86', packageType: 'jre', checkLatest: false }],
|
||||||
{
|
[{ version: '11.0.7', architecture: 'x64', packageType: 'jre', checkLatest: false }]
|
||||||
version: '15',
|
])('should throw an error for Available version not found for %s', async input => {
|
||||||
architecture: 'x86',
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
packageType: 'jre',
|
await expect(mockJavaBase.setupJava()).rejects.toThrowError('Available version not found');
|
||||||
checkLatest: false
|
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
||||||
}
|
expect(spyCoreAddPath).not.toHaveBeenCalled();
|
||||||
],
|
expect(spyCoreExportVariable).not.toHaveBeenCalled();
|
||||||
[
|
expect(spyCoreSetOutput).not.toHaveBeenCalled();
|
||||||
{
|
});
|
||||||
version: '11.0.7',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'should throw an error for Available version not found for %s',
|
|
||||||
async input => {
|
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
|
||||||
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
|
||||||
'Available version not found'
|
|
||||||
);
|
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
|
||||||
expect(spyCoreAddPath).not.toHaveBeenCalled();
|
|
||||||
expect(spyCoreExportVariable).not.toHaveBeenCalled();
|
|
||||||
expect(spyCoreSetOutput).not.toHaveBeenCalled();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('normalizeVersion', () => {
|
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 }],
|
||||||
['11.0', {version: '11.0', stable: true}],
|
['11.0', { version: '11.0', stable: true }],
|
||||||
['11.0.10', {version: '11.0.10', stable: true}],
|
['11.0.10', { version: '11.0.10', stable: true }],
|
||||||
['11-ea', {version: '11', stable: false}],
|
['11-ea', { version: '11', stable: false }],
|
||||||
['11.0.2-ea', {version: '11.0.2', stable: false}]
|
['11.0.2-ea', { version: '11.0.2', stable: false }]
|
||||||
])('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
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('normalizeVersion should throw an error for non semver', () => {
|
it('normalizeVersion should throw an error for non semver', () => {
|
||||||
const version = '11g';
|
const version = '11g';
|
||||||
expect(
|
expect(DummyJavaBase.prototype.normalizeVersion.bind(null, version)).toThrowError(
|
||||||
DummyJavaBase.prototype.normalizeVersion.bind(null, version)
|
|
||||||
).toThrow(
|
|
||||||
`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`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -574,14 +353,14 @@ describe('getToolcacheVersionName', () => {
|
|||||||
const DummyJavaBase = JavaBase as any;
|
const DummyJavaBase = JavaBase as any;
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[{version: '11', stable: true}, '11'],
|
[{ version: '11', stable: true }, '11'],
|
||||||
[{version: '11.0.2', stable: true}, '11.0.2'],
|
[{ version: '11.0.2', stable: true }, '11.0.2'],
|
||||||
[{version: '11.0.2+4', stable: true}, '11.0.2-4'],
|
[{ version: '11.0.2+4', stable: true }, '11.0.2-4'],
|
||||||
[{version: '11.0.2+4.1.2563234', stable: true}, '11.0.2-4.1.2563234'],
|
[{ version: '11.0.2+4.1.2563234', stable: true }, '11.0.2-4.1.2563234'],
|
||||||
[{version: '11.0', stable: false}, '11.0-ea'],
|
[{ version: '11.0', stable: false }, '11.0-ea'],
|
||||||
[{version: '11.0.3', stable: false}, '11.0.3-ea'],
|
[{ version: '11.0.3', stable: false }, '11.0.3-ea'],
|
||||||
[{version: '11.0.3+4', stable: false}, '11.0.3-ea.4'],
|
[{ version: '11.0.3+4', stable: false }, '11.0.3-ea.4'],
|
||||||
[{version: '11.0.3+4.2.256', stable: false}, '11.0.3-ea.4.2.256']
|
[{ version: '11.0.3+4.2.256', stable: false }, '11.0.3-ea.4.2.256']
|
||||||
])('returns correct version name for %s', (input, expected) => {
|
])('returns correct version name for %s', (input, expected) => {
|
||||||
const inputVersion = input.stable ? '11' : '11-ea';
|
const inputVersion = input.stable ? '11' : '11-ea';
|
||||||
const mockJavaBase = new EmptyJavaBase({
|
const mockJavaBase = new EmptyJavaBase({
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
import { HttpClient } from '@actions/http-client';
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
import { JavaInstallerOptions } from '../../src/distributions/base-models';
|
||||||
|
|
||||||
import {CorrettoDistribution} from '../../src/distributions/corretto/installer';
|
import { CorrettoDistribution } from '../../src/distributions/corretto/installer';
|
||||||
import * as util from '../../src/util';
|
import * as util from '../../src/util';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import {isGeneratorFunction} from 'util/types';
|
import { isGeneratorFunction } from 'util/types';
|
||||||
|
|
||||||
import manifestData from '../data/corretto.json';
|
const manifestData = require('../data/corretto.json') as [];
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: jest.SpyInstance;
|
||||||
@ -19,10 +19,7 @@ describe('getAvailableVersions', () => {
|
|||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData
|
result: manifestData
|
||||||
});
|
});
|
||||||
spyGetDownloadArchiveExtension = jest.spyOn(
|
spyGetDownloadArchiveExtension = jest.spyOn(util, 'getDownloadArchiveExtension');
|
||||||
util,
|
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@ -47,66 +44,16 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
|
[{ version: '16', architecture: 'x64', packageType: 'jdk', checkLatest: false }, 'macos', 6],
|
||||||
|
[{ version: '16', architecture: 'x86', packageType: 'jdk', checkLatest: false }, 'macos', 0],
|
||||||
|
[{ version: '16', architecture: 'x64', packageType: 'jre', checkLatest: false }, 'macos', 0],
|
||||||
|
[{ version: '16', architecture: 'x64', packageType: 'jdk', checkLatest: false }, 'linux', 6],
|
||||||
[
|
[
|
||||||
{
|
{ version: '18', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'macos',
|
|
||||||
6
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'macos',
|
|
||||||
0
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'macos',
|
|
||||||
0
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'linux',
|
|
||||||
6
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '18',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'windows',
|
'windows',
|
||||||
6
|
6
|
||||||
],
|
],
|
||||||
[
|
[{ version: '18', architecture: 'x64', packageType: 'jre', checkLatest: false }, 'windows', 1]
|
||||||
{
|
|
||||||
version: '18',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'windows',
|
|
||||||
1
|
|
||||||
]
|
|
||||||
])(
|
])(
|
||||||
'fetch expected amount of available versions for %s',
|
'fetch expected amount of available versions for %s',
|
||||||
async (
|
async (
|
||||||
@ -119,9 +66,7 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
const availableVersions = await distribution['getAvailableVersions']();
|
||||||
expect(availableVersions).not.toBeNull();
|
expect(availableVersions).not.toBeNull();
|
||||||
expect(availableVersions.length).toBe(
|
expect(availableVersions.length).toBe(expectedAmountOfAvailableVersions);
|
||||||
expectedAmountOfAvailableVersions
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -150,9 +95,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, platform);
|
mockPlatform(distribution, platform);
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
const availableVersion = await distribution['findPackageForDownload'](version);
|
||||||
version
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
});
|
});
|
||||||
@ -167,9 +110,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, 'linux');
|
mockPlatform(distribution, 'linux');
|
||||||
|
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload'](version)).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload'](version)
|
'Early access versions are not supported'
|
||||||
).rejects.toThrow('Early access versions are not supported');
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with non major version expect to throw not supported error', async () => {
|
it('with non major version expect to throw not supported error', async () => {
|
||||||
@ -182,9 +125,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, 'linux');
|
mockPlatform(distribution, 'linux');
|
||||||
|
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload'](version)).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload'](version)
|
'Only major versions are supported'
|
||||||
).rejects.toThrow('Only major versions are supported');
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with unfound version throw could not find error', async () => {
|
it('with unfound version throw could not find error', async () => {
|
||||||
@ -197,9 +140,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, 'linux');
|
mockPlatform(distribution, 'linux');
|
||||||
|
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload'](version)).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload'](version)
|
"Could not find satisfied version for SemVer '4'"
|
||||||
).rejects.toThrow("Could not find satisfied version for SemVer '4'");
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
@ -223,19 +166,14 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
|
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
const availableVersion = await distribution['findPackageForDownload'](version);
|
||||||
version
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const mockPlatform = (
|
const mockPlatform = (distribution: CorrettoDistribution, platform: string) => {
|
||||||
distribution: CorrettoDistribution,
|
|
||||||
platform: string
|
|
||||||
) => {
|
|
||||||
distribution['getPlatformOption'] = () => platform;
|
distribution['getPlatformOption'] = () => platform;
|
||||||
const mockedExtension = platform === 'windows' ? 'zip' : 'tar.gz';
|
const mockedExtension = platform === 'windows' ? 'zip' : 'tar.gz';
|
||||||
spyGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
spyGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
||||||
|
@ -1,257 +0,0 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import {DragonwellDistribution} from '../../src/distributions/dragonwell/installer';
|
|
||||||
import * as utils from '../../src/util';
|
|
||||||
|
|
||||||
import manifestData from '../data/dragonwell.json';
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient.mockReturnValue({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData
|
|
||||||
});
|
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
|
||||||
utils,
|
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
const mockPlatform = (
|
|
||||||
distribution: DragonwellDistribution,
|
|
||||||
platform: string
|
|
||||||
) => {
|
|
||||||
distribution['getPlatformOption'] = () => platform;
|
|
||||||
const mockedExtension = platform == 'windows' ? 'zip' : 'tar.gz';
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
it.each([
|
|
||||||
['8', 'x86', 'linux', 0],
|
|
||||||
['8', 'aarch64', 'linux', 28],
|
|
||||||
['8.6.6', 'x64', 'linux', 31],
|
|
||||||
['8', 'x86', 'anolis', 0],
|
|
||||||
['8', 'x86', 'windows', 0],
|
|
||||||
['8', 'x86', 'mac', 0],
|
|
||||||
['11', 'x64', 'linux', 31],
|
|
||||||
['11', 'aarch64', 'linux', 28],
|
|
||||||
['17', 'riscv', 'linux', 3],
|
|
||||||
['16.0.1', 'x64', 'linux', 31],
|
|
||||||
['21', 'x64', 'linux', 31]
|
|
||||||
])(
|
|
||||||
'should get right number of available versions from JSON',
|
|
||||||
async (
|
|
||||||
jdkVersion: string,
|
|
||||||
arch: string,
|
|
||||||
platform: string,
|
|
||||||
len: number
|
|
||||||
) => {
|
|
||||||
const distribution = new DragonwellDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
|
||||||
expect(availableVersions).not.toBeNull();
|
|
||||||
expect(availableVersions.length).toBe(len);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
'8',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'8',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_aarch64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'8',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_windows.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'8.13.14',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_aarch64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'riscv',
|
|
||||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_riscv64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_windows.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'alpine-linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/dragonwell-project/dragonwell11/releases/download/dragonwell-extended-11.0.23.20_jdk-11.0.23-ga/Alibaba_Dragonwell_Extended_11.0.23.20.9_x64_alpine-linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11.0.17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_aarch64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_windows.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'alpine-linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_alpine-linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.4',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.4.0.4%2B8_jdk-17.0.4-ga/Alibaba_Dragonwell_Standard_17.0.4.0.4%2B8_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.4+8',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.4.0.4%2B8_jdk-17.0.4-ga/Alibaba_Dragonwell_Standard_17.0.4.0.4%2B8_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'21',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_aarch64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'21.0.3+9',
|
|
||||||
'linux',
|
|
||||||
'riscv',
|
|
||||||
'https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.3.0.3%2B9_jdk-21.0.3-ga/Alibaba_Dragonwell_Standard_21.0.3.0.3.9_riscv64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'21.0.1+12',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/dragonwell-project/dragonwell21/releases/download/dragonwell-standard-21.0.1.0.1%2B12_jdk-21.0.1-ga/Alibaba_Dragonwell_Standard_21.0.1.0.1.12_x64_linux.tar.gz'
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'should return proper link according to the specified java-version, platform and arch',
|
|
||||||
async (
|
|
||||||
jdkVersion: string,
|
|
||||||
platform: string,
|
|
||||||
arch: string,
|
|
||||||
expectedLink: string
|
|
||||||
) => {
|
|
||||||
const distribution = new DragonwellDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
|
||||||
jdkVersion
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['8', 'alpine-linux', 'x64'],
|
|
||||||
['8', 'macos', 'aarch64'],
|
|
||||||
['11', 'macos', 'aarch64'],
|
|
||||||
['17', 'linux', 'riscv']
|
|
||||||
])(
|
|
||||||
'should throw when required version of JDK can not be found in the JSON',
|
|
||||||
async (jdkVersion: string, platform: string, arch: string) => {
|
|
||||||
const distribution = new DragonwellDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](jdkVersion)
|
|
||||||
).rejects.toThrow(
|
|
||||||
`Couldn't find any satisfied version for the specified java-version: "${jdkVersion}" and architecture: "${arch}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('should throw when required package type is not jdk', async () => {
|
|
||||||
const jdkVersion = '17';
|
|
||||||
const arch = 'x64';
|
|
||||||
const platform = 'linux';
|
|
||||||
const distribution = new DragonwellDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](jdkVersion)
|
|
||||||
).rejects.toThrow('Dragonwell provides only the `jdk` package type');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,152 +0,0 @@
|
|||||||
import {GraalVMDistribution} from '../../src/distributions/graalvm/installer';
|
|
||||||
import os from 'os';
|
|
||||||
import * as core from '@actions/core';
|
|
||||||
import {getDownloadArchiveExtension} from '../../src/util';
|
|
||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
let distribution: GraalVMDistribution;
|
|
||||||
let spyDebug: jest.SpyInstance;
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
distribution = new GraalVMDistribution({
|
|
||||||
version: '',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
spyDebug = jest.spyOn(core, 'debug');
|
|
||||||
spyDebug.mockImplementation(() => {});
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
'21',
|
|
||||||
'21',
|
|
||||||
'https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'21.0.4',
|
|
||||||
'21.0.4',
|
|
||||||
'https://download.oracle.com/graalvm/21/archive/graalvm-jdk-21.0.4_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'17',
|
|
||||||
'https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.12',
|
|
||||||
'17.0.12',
|
|
||||||
'https://download.oracle.com/graalvm/17/archive/graalvm-jdk-17.0.12_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
]
|
|
||||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
|
||||||
/* Needed only for this particular test because /latest/ urls tend to change */
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
|
|
||||||
spyHttpClient.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
message: {
|
|
||||||
statusCode: 200
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const result = await distribution['findPackageForDownload'](input);
|
|
||||||
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
|
|
||||||
expect(result.version).toBe(expectedVersion);
|
|
||||||
const osType = distribution.getPlatform();
|
|
||||||
const archiveType = getDownloadArchiveExtension();
|
|
||||||
const url = expectedUrl
|
|
||||||
.replace('{{OS_TYPE}}', osType)
|
|
||||||
.replace('{{ARCHIVE_TYPE}}', archiveType);
|
|
||||||
expect(result.url).toBe(url);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
'24-ea',
|
|
||||||
/^https:\/\/github\.com\/graalvm\/oracle-graalvm-ea-builds\/releases\/download\/jdk-24\.0\.0-ea\./
|
|
||||||
]
|
|
||||||
])('version is %s -> %s', async (version, expectedUrlPrefix) => {
|
|
||||||
/* Needed only for this particular test because /latest/ urls tend to change */
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
|
|
||||||
spyHttpClient.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
message: {
|
|
||||||
statusCode: 200
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const eaDistro = new GraalVMDistribution({
|
|
||||||
version,
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const versionWithoutEA = version.split('-')[0];
|
|
||||||
const result = await eaDistro['findPackageForDownload'](versionWithoutEA);
|
|
||||||
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
|
|
||||||
expect(result.url).toEqual(expect.stringMatching(expectedUrlPrefix));
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['amd64', 'x64'],
|
|
||||||
['arm64', 'aarch64']
|
|
||||||
])(
|
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
|
||||||
async (osArch: string, distroArch: string) => {
|
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
|
||||||
|
|
||||||
const version = '21';
|
|
||||||
const distro = new GraalVMDistribution({
|
|
||||||
version,
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const osType = distribution.getPlatform();
|
|
||||||
if (osType === 'windows' && distroArch == 'aarch64') {
|
|
||||||
return; // skip, aarch64 is not available for Windows
|
|
||||||
}
|
|
||||||
const archiveType = getDownloadArchiveExtension();
|
|
||||||
const result = await distro['findPackageForDownload'](version);
|
|
||||||
const expectedUrl = `https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}`;
|
|
||||||
|
|
||||||
expect(result.url).toBe(expectedUrl);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('should throw an error', async () => {
|
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
|
||||||
/GraalVM is only supported for JDK 17 and later/
|
|
||||||
);
|
|
||||||
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
|
||||||
/GraalVM is only supported for JDK 17 and later/
|
|
||||||
);
|
|
||||||
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
|
|
||||||
/Could not find GraalVM for SemVer */
|
|
||||||
);
|
|
||||||
|
|
||||||
const unavailableEADistro = new GraalVMDistribution({
|
|
||||||
version: '17-ea',
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
await expect(
|
|
||||||
unavailableEADistro['findPackageForDownload']('17')
|
|
||||||
).rejects.toThrow(
|
|
||||||
/No GraalVM EA build found\. Are you sure java-version: '17-ea' is correct\?/
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,118 +0,0 @@
|
|||||||
import https from 'https';
|
|
||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import {JetBrainsDistribution} from '../../src/distributions/jetbrains/installer';
|
|
||||||
|
|
||||||
import manifestData from '../data/jetbrains.json';
|
|
||||||
import os from 'os';
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient.mockReturnValue({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: []
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('load available versions', async () => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData as any
|
|
||||||
});
|
|
||||||
|
|
||||||
const distribution = new JetBrainsDistribution({
|
|
||||||
version: '17',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
|
||||||
expect(availableVersions).not.toBeNull();
|
|
||||||
|
|
||||||
const length =
|
|
||||||
os.platform() === 'win32' ? manifestData.length : manifestData.length + 2;
|
|
||||||
expect(availableVersions.length).toBe(length);
|
|
||||||
}, 10_000);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
it.each([
|
|
||||||
['17', '17.0.11+1207.24'],
|
|
||||||
['11.0', '11.0.16+2043.64'],
|
|
||||||
['11.0.11', '11.0.11+1542.1'],
|
|
||||||
['21.0.2', '21.0.2+375.1'],
|
|
||||||
['21', '21.0.3+465.3'],
|
|
||||||
['x', '21.0.3+465.3']
|
|
||||||
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
|
||||||
const distribution = new JetBrainsDistribution({
|
|
||||||
version: input,
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
|
||||||
expect(resolvedVersion.version).toBe(expected);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each(['17', '11.0', '11.0.11', '21.0.2', '21'])(
|
|
||||||
'version %s can be downloaded',
|
|
||||||
async input => {
|
|
||||||
const distribution = new JetBrainsDistribution({
|
|
||||||
version: input,
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload'](
|
|
||||||
input
|
|
||||||
);
|
|
||||||
const url = resolvedVersion.url;
|
|
||||||
const options = {method: 'HEAD'};
|
|
||||||
|
|
||||||
https.request(url, options, res => {
|
|
||||||
// JetBrains uses 403 for inexistent packages
|
|
||||||
expect(res.statusCode).not.toBe(403);
|
|
||||||
res.resume();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('version is not found', async () => {
|
|
||||||
const distribution = new JetBrainsDistribution({
|
|
||||||
version: '8.0.452',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(distribution['findPackageForDownload']('8.x')).rejects.toThrow(
|
|
||||||
/Could not find satisfied version for SemVer */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('version list is empty', async () => {
|
|
||||||
const distribution = new JetBrainsDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => [];
|
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
|
||||||
/Could not find satisfied version for SemVer */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,12 +1,9 @@
|
|||||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
import { LibericaDistributions } from '../../src/distributions/liberica/installer';
|
||||||
import {
|
import { ArchitectureOptions, LibericaVersion } from '../../src/distributions/liberica/models';
|
||||||
ArchitectureOptions,
|
import { HttpClient } from '@actions/http-client';
|
||||||
LibericaVersion
|
|
||||||
} from '../../src/distributions/liberica/models';
|
|
||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import manifestData from '../data/liberica.json';
|
const manifestData = require('../data/liberica.json') as LibericaVersion[];
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: jest.SpyInstance;
|
||||||
@ -16,7 +13,7 @@ describe('getAvailableVersions', () => {
|
|||||||
spyHttpClient.mockReturnValue({
|
spyHttpClient.mockReturnValue({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as LibericaVersion[]
|
result: manifestData
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -28,57 +25,27 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.x', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.x',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=all'
|
'bundle-type=jdk&bitness=32&arch=x86&build-type=all'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11-ea', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=ea'
|
'bundle-type=jdk&bitness=32&arch=x86&build-type=ea'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '16.0.2', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '16.0.2',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=64&arch=x86&build-type=all'
|
'bundle-type=jdk&bitness=64&arch=x86&build-type=all'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '16.0.2', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '16.0.2',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jre&bitness=64&arch=x86&build-type=all'
|
'bundle-type=jre&bitness=64&arch=x86&build-type=all'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '8', architecture: 'armv7', packageType: 'jdk+fx', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'armv7',
|
|
||||||
packageType: 'jdk+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk-full&bitness=32&arch=arm&build-type=all'
|
'bundle-type=jdk-full&bitness=32&arch=arm&build-type=all'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '8', architecture: 'aarch64', packageType: 'jre+fx', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'aarch64',
|
|
||||||
packageType: 'jre+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jre-full&bitness=64&arch=arm&build-type=all'
|
'bundle-type=jre-full&bitness=64&arch=arm&build-type=all'
|
||||||
]
|
]
|
||||||
])('build correct url for %s -> %s', async (input, urlParams) => {
|
])('build correct url for %s -> %s', async (input, urlParams) => {
|
||||||
@ -100,8 +67,8 @@ describe('getAvailableVersions', () => {
|
|||||||
arch: string;
|
arch: string;
|
||||||
};
|
};
|
||||||
it.each([
|
it.each([
|
||||||
['amd64', {bitness: '64', arch: 'x86'}],
|
['amd64', { bitness: '64', arch: 'x86' }],
|
||||||
['arm64', {bitness: '64', arch: 'arm'}]
|
['arm64', { bitness: '64', arch: 'arm' }]
|
||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
@ -142,24 +109,21 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
['x86', {bitness: '32', arch: 'x86'}],
|
['x86', { bitness: '32', arch: 'x86' }],
|
||||||
['x64', {bitness: '64', arch: 'x86'}],
|
['x64', { bitness: '64', arch: 'x86' }],
|
||||||
['armv7', {bitness: '32', arch: 'arm'}],
|
['armv7', { bitness: '32', arch: 'arm' }],
|
||||||
['aarch64', {bitness: '64', arch: 'arm'}],
|
['aarch64', { bitness: '64', arch: 'arm' }],
|
||||||
['ppc64le', {bitness: '64', arch: 'ppc'}]
|
['ppc64le', { bitness: '64', arch: 'ppc' }]
|
||||||
] as [string, ArchitectureOptions][])(
|
] as [string, ArchitectureOptions][])('parse architecture %s -> %s', (input, expected) => {
|
||||||
'parse architecture %s -> %s',
|
const distributions = new LibericaDistributions({
|
||||||
(input, expected) => {
|
architecture: input,
|
||||||
const distributions = new LibericaDistributions({
|
checkLatest: false,
|
||||||
architecture: input,
|
packageType: '',
|
||||||
checkLatest: false,
|
version: ''
|
||||||
packageType: '',
|
});
|
||||||
version: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(distributions['getArchitectureOptions']()).toEqual(expected);
|
expect(distributions['getArchitectureOptions']()).toEqual(expected);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['armv6', 's390x'])('not support architecture %s', input => {
|
it.each(['armv6', 's390x'])('not support architecture %s', input => {
|
||||||
const distributions = new LibericaDistributions({
|
const distributions = new LibericaDistributions({
|
||||||
@ -235,9 +199,9 @@ describe('getPlatformOption', () => {
|
|||||||
it.each(['aix', 'android', 'freebsd', 'openbsd', 'netbsd'])(
|
it.each(['aix', 'android', 'freebsd', 'openbsd', 'netbsd'])(
|
||||||
'not support os version %s',
|
'not support os version %s',
|
||||||
input => {
|
input => {
|
||||||
expect(() =>
|
expect(() => distributions['getPlatformOption'](input as NodeJS.Platform)).toThrow(
|
||||||
distributions['getPlatformOption'](input as NodeJS.Platform)
|
/Platform '\w+' is not supported\. Supported platforms: .+/
|
||||||
).toThrow(/Platform '\w+' is not supported\. Supported platforms: .+/);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@ -251,33 +215,9 @@ describe('convertVersionToSemver', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[{ featureVersion: 11, interimVersion: 0, updateVersion: 12, buildVersion: 7 }, '11.0.12+7'],
|
||||||
{
|
[{ featureVersion: 11, interimVersion: 0, updateVersion: 12, buildVersion: 0 }, '11.0.12'],
|
||||||
featureVersion: 11,
|
[{ featureVersion: 11, interimVersion: 0, updateVersion: 0, buildVersion: 13 }, '11.0.0+13']
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 12,
|
|
||||||
buildVersion: 7
|
|
||||||
},
|
|
||||||
'11.0.12+7'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 12,
|
|
||||||
buildVersion: 0
|
|
||||||
},
|
|
||||||
'11.0.12'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 0,
|
|
||||||
buildVersion: 13
|
|
||||||
},
|
|
||||||
'11.0.0+13'
|
|
||||||
]
|
|
||||||
])('%s -> %s', (input, expected) => {
|
])('%s -> %s', (input, expected) => {
|
||||||
const actual = distributions['convertVersionToSemver']({
|
const actual = distributions['convertVersionToSemver']({
|
||||||
downloadUrl: '',
|
downloadUrl: '',
|
||||||
|
@ -1,290 +0,0 @@
|
|||||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
|
||||||
import {
|
|
||||||
ArchitectureOptions,
|
|
||||||
LibericaVersion
|
|
||||||
} from '../../src/distributions/liberica/models';
|
|
||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import os from 'os';
|
|
||||||
|
|
||||||
import manifestData from '../data/liberica-linux.json';
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient.mockReturnValue({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData as LibericaVersion[]
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '11.x',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=all'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=ea'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16.0.2',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=64&arch=x86&build-type=all'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16.0.2',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jre&bitness=64&arch=x86&build-type=all'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '8',
|
|
||||||
architecture: 'armv7',
|
|
||||||
packageType: 'jdk+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk-full&bitness=32&arch=arm&build-type=all'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '8',
|
|
||||||
architecture: 'aarch64',
|
|
||||||
packageType: 'jre+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jre-full&bitness=64&arch=arm&build-type=all'
|
|
||||||
]
|
|
||||||
])('build correct url for %s -> %s', async (input, urlParams) => {
|
|
||||||
const additionalParams =
|
|
||||||
'&installation-type=archive&fields=downloadUrl%2Cversion%2CfeatureVersion%2CinterimVersion%2C' +
|
|
||||||
'updateVersion%2CbuildVersion';
|
|
||||||
const distribution = new LibericaDistributions(input);
|
|
||||||
distribution['getPlatformOption'] = () => 'linux';
|
|
||||||
const buildUrl = `https://api.bell-sw.com/v1/liberica/releases?os=linux&${urlParams}${additionalParams}`;
|
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
|
||||||
|
|
||||||
expect(spyHttpClient.mock.calls).toHaveLength(1);
|
|
||||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
|
||||||
});
|
|
||||||
|
|
||||||
type DistroArch = {
|
|
||||||
bitness: string;
|
|
||||||
arch: string;
|
|
||||||
};
|
|
||||||
it.each([
|
|
||||||
['amd64', {bitness: '64', arch: 'x86'}],
|
|
||||||
['arm64', {bitness: '64', arch: 'arm'}]
|
|
||||||
])(
|
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
|
||||||
|
|
||||||
const distribution = new LibericaDistributions({
|
|
||||||
version: '17',
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const additionalParams =
|
|
||||||
'&installation-type=archive&fields=downloadUrl%2Cversion%2CfeatureVersion%2CinterimVersion%2C' +
|
|
||||||
'updateVersion%2CbuildVersion';
|
|
||||||
distribution['getPlatformOption'] = () => 'linux';
|
|
||||||
|
|
||||||
const buildUrl = `https://api.bell-sw.com/v1/liberica/releases?os=linux&bundle-type=jdk&bitness=${distroArch.bitness}&arch=${distroArch.arch}&build-type=all${additionalParams}`;
|
|
||||||
|
|
||||||
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 LibericaDistributions({
|
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
|
||||||
expect(availableVersions).toEqual(manifestData);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getArchitectureOptions', () => {
|
|
||||||
it.each([
|
|
||||||
['x86', {bitness: '32', arch: 'x86'}],
|
|
||||||
['x64', {bitness: '64', arch: 'x86'}],
|
|
||||||
['armv7', {bitness: '32', arch: 'arm'}],
|
|
||||||
['aarch64', {bitness: '64', arch: 'arm'}],
|
|
||||||
['ppc64le', {bitness: '64', arch: 'ppc'}]
|
|
||||||
] as [string, ArchitectureOptions][])(
|
|
||||||
'parse architecture %s -> %s',
|
|
||||||
(input, expected) => {
|
|
||||||
const distributions = new LibericaDistributions({
|
|
||||||
architecture: input,
|
|
||||||
checkLatest: false,
|
|
||||||
packageType: '',
|
|
||||||
version: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(distributions['getArchitectureOptions']()).toEqual(expected);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['armv6', 's390x'])('not support architecture %s', input => {
|
|
||||||
const distributions = new LibericaDistributions({
|
|
||||||
architecture: input,
|
|
||||||
checkLatest: false,
|
|
||||||
packageType: '',
|
|
||||||
version: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(() => distributions['getArchitectureOptions']()).toThrow(
|
|
||||||
/Architecture '\w+' is not supported\. Supported architectures: .*/
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
let distribution: LibericaDistributions;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
distribution = new LibericaDistributions({
|
|
||||||
version: '',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData;
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['8', '8.0.302+8'],
|
|
||||||
['11.x', '11.0.12+7'],
|
|
||||||
['8.0', '8.0.302+8'],
|
|
||||||
['11.0.x', '11.0.12+7'],
|
|
||||||
['15', '15.0.2+10'],
|
|
||||||
['15.0', '15.0.2+10'],
|
|
||||||
['15.0.0', '15.0.0+36'],
|
|
||||||
['8.0.232', '8.0.232+10'],
|
|
||||||
['8.0.232+9', '8.0.232+9'],
|
|
||||||
['15.0.2+8', '15.0.2+8'],
|
|
||||||
['15.0.2+10', '15.0.2+10']
|
|
||||||
])('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']('18')).rejects.toThrow(
|
|
||||||
/Could not find satisfied version for semver */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getPlatformOption', () => {
|
|
||||||
const distributions = new LibericaDistributions({
|
|
||||||
architecture: 'x64',
|
|
||||||
version: '11',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['linux', 'linux'],
|
|
||||||
['darwin', 'macos'],
|
|
||||||
['win32', 'windows'],
|
|
||||||
['cygwin', 'windows'],
|
|
||||||
['sunos', 'solaris']
|
|
||||||
])('os version %s -> %s', (input, expected) => {
|
|
||||||
const actual = distributions['getPlatformOption'](input as NodeJS.Platform);
|
|
||||||
|
|
||||||
expect(actual).toEqual(expected);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each(['aix', 'android', 'freebsd', 'openbsd', 'netbsd'])(
|
|
||||||
'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 LibericaDistributions({
|
|
||||||
architecture: 'x64',
|
|
||||||
version: '11',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 12,
|
|
||||||
buildVersion: 7
|
|
||||||
},
|
|
||||||
'11.0.12+7'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 12,
|
|
||||||
buildVersion: 0
|
|
||||||
},
|
|
||||||
'11.0.12'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 0,
|
|
||||||
buildVersion: 13
|
|
||||||
},
|
|
||||||
'11.0.0+13'
|
|
||||||
]
|
|
||||||
])('%s -> %s', (input, expected) => {
|
|
||||||
const actual = distributions['convertVersionToSemver']({
|
|
||||||
downloadUrl: '',
|
|
||||||
version: '',
|
|
||||||
...input
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(actual).toEqual(expected);
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,290 +0,0 @@
|
|||||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
|
||||||
import {
|
|
||||||
ArchitectureOptions,
|
|
||||||
LibericaVersion
|
|
||||||
} from '../../src/distributions/liberica/models';
|
|
||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import os from 'os';
|
|
||||||
|
|
||||||
import manifestData from '../data/liberica-windows.json';
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient.mockReturnValue({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData as LibericaVersion[]
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '11.x',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=all'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=ea'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16.0.2',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=64&arch=x86&build-type=all'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16.0.2',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jre&bitness=64&arch=x86&build-type=all'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '8',
|
|
||||||
architecture: 'armv7',
|
|
||||||
packageType: 'jdk+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk-full&bitness=32&arch=arm&build-type=all'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '8',
|
|
||||||
architecture: 'aarch64',
|
|
||||||
packageType: 'jre+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jre-full&bitness=64&arch=arm&build-type=all'
|
|
||||||
]
|
|
||||||
])('build correct url for %s -> %s', async (input, urlParams) => {
|
|
||||||
const additionalParams =
|
|
||||||
'&installation-type=archive&fields=downloadUrl%2Cversion%2CfeatureVersion%2CinterimVersion%2C' +
|
|
||||||
'updateVersion%2CbuildVersion';
|
|
||||||
const distribution = new LibericaDistributions(input);
|
|
||||||
distribution['getPlatformOption'] = () => 'windows';
|
|
||||||
const buildUrl = `https://api.bell-sw.com/v1/liberica/releases?os=windows&${urlParams}${additionalParams}`;
|
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
|
||||||
|
|
||||||
expect(spyHttpClient.mock.calls).toHaveLength(1);
|
|
||||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
|
||||||
});
|
|
||||||
|
|
||||||
type DistroArch = {
|
|
||||||
bitness: string;
|
|
||||||
arch: string;
|
|
||||||
};
|
|
||||||
it.each([
|
|
||||||
['amd64', {bitness: '64', arch: 'x86'}],
|
|
||||||
['arm64', {bitness: '64', arch: 'arm'}]
|
|
||||||
])(
|
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
|
||||||
|
|
||||||
const distribution = new LibericaDistributions({
|
|
||||||
version: '17',
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const additionalParams =
|
|
||||||
'&installation-type=archive&fields=downloadUrl%2Cversion%2CfeatureVersion%2CinterimVersion%2C' +
|
|
||||||
'updateVersion%2CbuildVersion';
|
|
||||||
distribution['getPlatformOption'] = () => 'windows';
|
|
||||||
|
|
||||||
const buildUrl = `https://api.bell-sw.com/v1/liberica/releases?os=windows&bundle-type=jdk&bitness=${distroArch.bitness}&arch=${distroArch.arch}&build-type=all${additionalParams}`;
|
|
||||||
|
|
||||||
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 LibericaDistributions({
|
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
|
||||||
expect(availableVersions).toEqual(manifestData);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getArchitectureOptions', () => {
|
|
||||||
it.each([
|
|
||||||
['x86', {bitness: '32', arch: 'x86'}],
|
|
||||||
['x64', {bitness: '64', arch: 'x86'}],
|
|
||||||
['armv7', {bitness: '32', arch: 'arm'}],
|
|
||||||
['aarch64', {bitness: '64', arch: 'arm'}],
|
|
||||||
['ppc64le', {bitness: '64', arch: 'ppc'}]
|
|
||||||
] as [string, ArchitectureOptions][])(
|
|
||||||
'parse architecture %s -> %s',
|
|
||||||
(input, expected) => {
|
|
||||||
const distributions = new LibericaDistributions({
|
|
||||||
architecture: input,
|
|
||||||
checkLatest: false,
|
|
||||||
packageType: '',
|
|
||||||
version: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(distributions['getArchitectureOptions']()).toEqual(expected);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['armv6', 's390x'])('not support architecture %s', input => {
|
|
||||||
const distributions = new LibericaDistributions({
|
|
||||||
architecture: input,
|
|
||||||
checkLatest: false,
|
|
||||||
packageType: '',
|
|
||||||
version: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(() => distributions['getArchitectureOptions']()).toThrow(
|
|
||||||
/Architecture '\w+' is not supported\. Supported architectures: .*/
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
let distribution: LibericaDistributions;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
distribution = new LibericaDistributions({
|
|
||||||
version: '',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData;
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['8', '8.0.302+8'],
|
|
||||||
['11.x', '11.0.12+7'],
|
|
||||||
['8.0', '8.0.302+8'],
|
|
||||||
['11.0.x', '11.0.12+7'],
|
|
||||||
['15', '15.0.2+10'],
|
|
||||||
['15.0', '15.0.2+10'],
|
|
||||||
['15.0.0', '15.0.0+36'],
|
|
||||||
['8.0.232', '8.0.232+10'],
|
|
||||||
['8.0.232+9', '8.0.232+9'],
|
|
||||||
['15.0.2+8', '15.0.2+8'],
|
|
||||||
['15.0.2+10', '15.0.2+10']
|
|
||||||
])('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']('18')).rejects.toThrow(
|
|
||||||
/Could not find satisfied version for semver */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getPlatformOption', () => {
|
|
||||||
const distributions = new LibericaDistributions({
|
|
||||||
architecture: 'x64',
|
|
||||||
version: '11',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['linux', 'linux'],
|
|
||||||
['darwin', 'macos'],
|
|
||||||
['win32', 'windows'],
|
|
||||||
['cygwin', 'windows'],
|
|
||||||
['sunos', 'solaris']
|
|
||||||
])('os version %s -> %s', (input, expected) => {
|
|
||||||
const actual = distributions['getPlatformOption'](input as NodeJS.Platform);
|
|
||||||
|
|
||||||
expect(actual).toEqual(expected);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each(['aix', 'android', 'freebsd', 'openbsd', 'netbsd'])(
|
|
||||||
'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 LibericaDistributions({
|
|
||||||
architecture: 'x64',
|
|
||||||
version: '11',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 12,
|
|
||||||
buildVersion: 7
|
|
||||||
},
|
|
||||||
'11.0.12+7'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 12,
|
|
||||||
buildVersion: 0
|
|
||||||
},
|
|
||||||
'11.0.12'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 0,
|
|
||||||
buildVersion: 13
|
|
||||||
},
|
|
||||||
'11.0.0+13'
|
|
||||||
]
|
|
||||||
])('%s -> %s', (input, expected) => {
|
|
||||||
const actual = distributions['convertVersionToSemver']({
|
|
||||||
downloadUrl: '',
|
|
||||||
version: '',
|
|
||||||
...input
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(actual).toEqual(expected);
|
|
||||||
});
|
|
||||||
});
|
|
@ -7,7 +7,7 @@ import path from 'path';
|
|||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
import * as util from '../../src/util';
|
import * as util from '../../src/util';
|
||||||
|
|
||||||
import {LocalDistribution} from '../../src/distributions/local/installer';
|
import { LocalDistribution } from '../../src/distributions/local/installer';
|
||||||
|
|
||||||
describe('setupJava', () => {
|
describe('setupJava', () => {
|
||||||
const actualJavaVersion = '11.1.10';
|
const actualJavaVersion = '11.1.10';
|
||||||
@ -27,7 +27,7 @@ describe('setupJava', () => {
|
|||||||
let spyFsReadDir: jest.SpyInstance;
|
let spyFsReadDir: jest.SpyInstance;
|
||||||
let spyUtilsExtractJdkFile: jest.SpyInstance;
|
let spyUtilsExtractJdkFile: jest.SpyInstance;
|
||||||
let spyPathResolve: jest.SpyInstance;
|
let spyPathResolve: jest.SpyInstance;
|
||||||
const expectedJdkFile = 'JavaLocalJdkFile';
|
let expectedJdkFile = 'JavaLocalJdkFile';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
||||||
@ -35,27 +35,18 @@ describe('setupJava', () => {
|
|||||||
(toolname: string, javaVersion: string, architecture: string) => {
|
(toolname: string, javaVersion: string, architecture: string) => {
|
||||||
const semverVersion = new semver.Range(javaVersion);
|
const semverVersion = new semver.Range(javaVersion);
|
||||||
|
|
||||||
if (
|
if (path.basename(javaPath) !== architecture || !javaPath.includes(toolname)) {
|
||||||
path.basename(javaPath) !== architecture ||
|
|
||||||
!javaPath.includes(toolname)
|
|
||||||
) {
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return semver.satisfies(actualJavaVersion, semverVersion)
|
return semver.satisfies(actualJavaVersion, semverVersion) ? javaPath : '';
|
||||||
? javaPath
|
|
||||||
: '';
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
spyTcCacheDir = jest.spyOn(tc, 'cacheDir');
|
spyTcCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||||
spyTcCacheDir.mockImplementation(
|
spyTcCacheDir.mockImplementation(
|
||||||
(
|
(archivePath: string, toolcacheFolderName: string, version: string, architecture: string) =>
|
||||||
archivePath: string,
|
path.join(toolcacheFolderName, version, architecture)
|
||||||
toolcacheFolderName: string,
|
|
||||||
version: string,
|
|
||||||
architecture: string
|
|
||||||
) => path.join(toolcacheFolderName, version, architecture)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
||||||
@ -83,7 +74,7 @@ describe('setupJava', () => {
|
|||||||
|
|
||||||
spyFsStat = jest.spyOn(fs, 'statSync');
|
spyFsStat = jest.spyOn(fs, 'statSync');
|
||||||
spyFsStat.mockImplementation((file: string) => {
|
spyFsStat.mockImplementation((file: string) => {
|
||||||
return {isFile: () => file === expectedJdkFile};
|
return { isFile: () => file === expectedJdkFile };
|
||||||
});
|
});
|
||||||
|
|
||||||
// Spy on util methods
|
// Spy on util methods
|
||||||
@ -117,9 +108,7 @@ describe('setupJava', () => {
|
|||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
expect(spyGetToolcachePath).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${actualJavaVersion} from tool-cache`);
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
||||||
);
|
);
|
||||||
@ -141,9 +130,7 @@ describe('setupJava', () => {
|
|||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
expect(spyGetToolcachePath).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${actualJavaVersion} from tool-cache`);
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
||||||
);
|
);
|
||||||
@ -168,9 +155,7 @@ describe('setupJava', () => {
|
|||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
`Resolved Java ${actualJavaVersion} from tool-cache`
|
||||||
);
|
);
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Extracting Java from '${jdkFile}'`);
|
||||||
`Extracting Java from '${jdkFile}'`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
||||||
);
|
);
|
||||||
@ -186,163 +171,46 @@ describe('setupJava', () => {
|
|||||||
const jdkFile = 'not_existing_one';
|
const jdkFile = 'not_existing_one';
|
||||||
const expected = {
|
const expected = {
|
||||||
javaVersion: '11.0.289',
|
javaVersion: '11.0.289',
|
||||||
javaPath: path.join(
|
javaPath: path.join('Java_jdkfile_jdk', inputs.version, inputs.architecture)
|
||||||
'Java_jdkfile_jdk',
|
|
||||||
inputs.version,
|
|
||||||
inputs.architecture
|
|
||||||
)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
expected.javaPath = path.join(
|
expected.javaPath = path.join('Java_jdkfile_jdk', inputs.version, inputs.architecture);
|
||||||
'Java_jdkfile_jdk',
|
await expect(mockJavaBase.setupJava()).rejects.toThrowError(
|
||||||
inputs.version,
|
|
||||||
inputs.architecture
|
|
||||||
);
|
|
||||||
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
|
||||||
"JDK file was not found in path 'not_existing_one'"
|
"JDK file was not found in path 'not_existing_one'"
|
||||||
);
|
);
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
`Resolved Java ${actualJavaVersion} from tool-cache`
|
||||||
);
|
);
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(`Extracting Java from '${jdkFile}'`);
|
||||||
`Extracting Java from '${jdkFile}'`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('java is resolved from toolcache including Contents/Home on MacOS', async () => {
|
|
||||||
const inputs = {
|
|
||||||
version: actualJavaVersion,
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
};
|
|
||||||
const jdkFile = 'not_existing_one';
|
|
||||||
const expected = {
|
|
||||||
version: actualJavaVersion,
|
|
||||||
path: path.join(
|
|
||||||
'Java_jdkfile_jdk',
|
|
||||||
inputs.version,
|
|
||||||
inputs.architecture,
|
|
||||||
'Contents',
|
|
||||||
'Home'
|
|
||||||
)
|
|
||||||
};
|
|
||||||
const originalPlatform = process.platform;
|
|
||||||
Object.defineProperty(process, 'platform', {
|
|
||||||
value: 'darwin'
|
|
||||||
});
|
|
||||||
|
|
||||||
spyFsStat = jest.spyOn(fs, 'existsSync');
|
|
||||||
spyFsStat.mockImplementation((file: string) => {
|
|
||||||
return file.endsWith('Home');
|
|
||||||
});
|
|
||||||
|
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
|
||||||
);
|
|
||||||
|
|
||||||
Object.defineProperty(process, 'platform', {
|
|
||||||
value: originalPlatform
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('java is unpacked from jdkfile including Contents/Home on MacOS', async () => {
|
|
||||||
const inputs = {
|
|
||||||
version: '11.0.289',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
};
|
|
||||||
const jdkFile = expectedJdkFile;
|
|
||||||
const expected = {
|
|
||||||
version: '11.0.289',
|
|
||||||
path: path.join(
|
|
||||||
'Java_jdkfile_jdk',
|
|
||||||
inputs.version,
|
|
||||||
inputs.architecture,
|
|
||||||
'Contents',
|
|
||||||
'Home'
|
|
||||||
)
|
|
||||||
};
|
|
||||||
const originalPlatform = process.platform;
|
|
||||||
Object.defineProperty(process, 'platform', {
|
|
||||||
value: 'darwin'
|
|
||||||
});
|
|
||||||
spyFsStat = jest.spyOn(fs, 'existsSync');
|
|
||||||
spyFsStat.mockImplementation((file: string) => {
|
|
||||||
return file.endsWith('Home');
|
|
||||||
});
|
|
||||||
|
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Extracting Java from '${jdkFile}'`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
|
||||||
);
|
|
||||||
Object.defineProperty(process, 'platform', {
|
|
||||||
value: originalPlatform
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '8.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '8.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'otherJdkFile'
|
'otherJdkFile'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'otherJdkFile'
|
'otherJdkFile'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '12.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '12.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'otherJdkFile'
|
'otherJdkFile'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.1.11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.1.11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'not_existing_one'
|
'not_existing_one'
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
`Throw an error if jdkfile has wrong path, inputs %s, jdkfile %s, real name ${expectedJdkFile}`,
|
`Throw an error if jdkfile has wrong path, inputs %s, jdkfile %s, real name ${expectedJdkFile}`,
|
||||||
async (inputs, jdkFile) => {
|
async (inputs, jdkFile) => {
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
await expect(mockJavaBase.setupJava()).rejects.toThrowError(
|
||||||
/JDK file was not found in path */
|
/JDK file was not found in path */
|
||||||
);
|
);
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
||||||
@ -350,41 +218,18 @@ describe('setupJava', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
|
[{ version: '8.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false }, ''],
|
||||||
[
|
[
|
||||||
{
|
{ version: '7.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '8.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
''
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '7.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
undefined
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
undefined
|
undefined
|
||||||
]
|
]
|
||||||
])(
|
])('Throw an error if jdkfile is not specified, inputs %s', async (inputs, jdkFile) => {
|
||||||
'Throw an error if jdkfile is not specified, inputs %s',
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
async (inputs, jdkFile) => {
|
await expect(mockJavaBase.setupJava()).rejects.toThrowError("'jdkFile' is not specified");
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
||||||
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
});
|
||||||
"'jdkFile' is not specified"
|
|
||||||
);
|
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {MicrosoftDistributions} from '../../src/distributions/microsoft/installer';
|
import { MicrosoftDistributions } from '../../src/distributions/microsoft/installer';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import data from '../data/microsoft.json';
|
import data from '../../src/distributions/microsoft/microsoft-openjdk-versions.json';
|
||||||
import * as httpm from '@actions/http-client';
|
import * as httpm from '@actions/http-client';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
@ -29,11 +29,6 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
|
||||||
'21.x',
|
|
||||||
'21.0.0',
|
|
||||||
'https://aka.ms/download-jdk/microsoft-jdk-21.0.0-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
|
||||||
[
|
[
|
||||||
'17.0.1',
|
'17.0.1',
|
||||||
'17.0.1+12.1',
|
'17.0.1+12.1',
|
||||||
@ -41,8 +36,8 @@ describe('findPackageForDownload', () => {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'17.x',
|
'17.x',
|
||||||
'17.0.7',
|
'17.0.3',
|
||||||
'https://aka.ms/download-jdk/microsoft-jdk-17.0.7-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
'https://aka.ms/download-jdk/microsoft-jdk-17.0.3-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'16.0.x',
|
'16.0.x',
|
||||||
@ -58,11 +53,6 @@ describe('findPackageForDownload', () => {
|
|||||||
'11.0.15',
|
'11.0.15',
|
||||||
'11.0.15',
|
'11.0.15',
|
||||||
'https://aka.ms/download-jdk/microsoft-jdk-11.0.15-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
'https://aka.ms/download-jdk/microsoft-jdk-11.0.15-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||||
],
|
|
||||||
[
|
|
||||||
'11.x',
|
|
||||||
'11.0.19',
|
|
||||||
'https://aka.ms/download-jdk/microsoft-jdk-11.0.19-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
|
||||||
]
|
]
|
||||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
||||||
const result = await distribution['findPackageForDownload'](input);
|
const result = await distribution['findPackageForDownload'](input);
|
||||||
@ -83,36 +73,10 @@ describe('findPackageForDownload', () => {
|
|||||||
archive = 'tar.gz';
|
archive = 'tar.gz';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const url = expectedUrl
|
const url = expectedUrl.replace('{{OS_TYPE}}', os).replace('{{ARCHIVE_TYPE}}', archive);
|
||||||
.replace('{{OS_TYPE}}', os)
|
|
||||||
.replace('{{ARCHIVE_TYPE}}', archive);
|
|
||||||
expect(result.url).toBe(url);
|
expect(result.url).toBe(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
|
||||||
['amd64', 'x64'],
|
|
||||||
['arm64', 'aarch64']
|
|
||||||
])(
|
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
|
||||||
async (osArch: string, distroArch: string) => {
|
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('darwin');
|
|
||||||
|
|
||||||
const version = '17';
|
|
||||||
const distro = new MicrosoftDistributions({
|
|
||||||
version,
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const result = await distro['findPackageForDownload'](version);
|
|
||||||
const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-${distroArch}.tar.gz`;
|
|
||||||
|
|
||||||
expect(result.url).toBe(expectedUrl);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['amd64', 'x64'],
|
['amd64', 'x64'],
|
||||||
['arm64', 'aarch64']
|
['arm64', 'aarch64']
|
||||||
@ -131,31 +95,7 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const result = await distro['findPackageForDownload'](version);
|
const result = await distro['findPackageForDownload'](version);
|
||||||
const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-${distroArch}.tar.gz`;
|
const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.3-linux-${distroArch}.tar.gz`;
|
||||||
|
|
||||||
expect(result.url).toBe(expectedUrl);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['amd64', 'x64'],
|
|
||||||
['arm64', 'aarch64']
|
|
||||||
])(
|
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
|
||||||
async (osArch: string, distroArch: string) => {
|
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('win32');
|
|
||||||
|
|
||||||
const version = '17';
|
|
||||||
const distro = new MicrosoftDistributions({
|
|
||||||
version,
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const result = await distro['findPackageForDownload'](version);
|
|
||||||
const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.7-windows-${distroArch}.zip`;
|
|
||||||
|
|
||||||
expect(result.url).toBe(expectedUrl);
|
expect(result.url).toBe(expectedUrl);
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,11 @@
|
|||||||
import {OracleDistribution} from '../../src/distributions/oracle/installer';
|
import { OracleDistribution } from '../../src/distributions/oracle/installer';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {getDownloadArchiveExtension} from '../../src/util';
|
import { getDownloadArchiveExtension } from '../../src/util';
|
||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
describe('findPackageForDownload', () => {
|
||||||
let distribution: OracleDistribution;
|
let distribution: OracleDistribution;
|
||||||
let spyDebug: jest.SpyInstance;
|
let spyDebug: jest.SpyInstance;
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
distribution = new OracleDistribution({
|
distribution = new OracleDistribution({
|
||||||
@ -23,24 +21,19 @@ describe('findPackageForDownload', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
'21',
|
'19',
|
||||||
'21',
|
'19',
|
||||||
'https://download.oracle.com/java/21/latest/jdk-21_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
'https://download.oracle.com/java/19/latest/jdk-19_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'20',
|
'19.0.1',
|
||||||
'20',
|
'19.0.1',
|
||||||
'https://download.oracle.com/java/20/latest/jdk-20_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
'https://download.oracle.com/java/19/archive/jdk-19.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'18',
|
'18.0.2.1',
|
||||||
'18',
|
'18.0.2.1',
|
||||||
'https://download.oracle.com/java/18/archive/jdk-18_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
'https://download.oracle.com/java/18/archive/jdk-18.0.2.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||||
],
|
|
||||||
[
|
|
||||||
'20.0.1',
|
|
||||||
'20.0.1',
|
|
||||||
'https://download.oracle.com/java/20/archive/jdk-20.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'17',
|
'17',
|
||||||
@ -53,39 +46,11 @@ describe('findPackageForDownload', () => {
|
|||||||
'https://download.oracle.com/java/17/archive/jdk-17.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
'https://download.oracle.com/java/17/archive/jdk-17.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||||
]
|
]
|
||||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
||||||
/* Needed only for this particular test because some urls might change */
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
|
|
||||||
spyHttpClient.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
message: {
|
|
||||||
statusCode: 200
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NOTE - Should fail to retrieve 18 from latest and check archive instead
|
|
||||||
*/
|
|
||||||
if (input === '18') {
|
|
||||||
spyHttpClient.mockReturnValueOnce(
|
|
||||||
Promise.resolve({
|
|
||||||
message: {
|
|
||||||
statusCode: 404
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await distribution['findPackageForDownload'](input);
|
const result = await distribution['findPackageForDownload'](input);
|
||||||
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
|
|
||||||
expect(result.version).toBe(expectedVersion);
|
expect(result.version).toBe(expectedVersion);
|
||||||
const osType = distribution.getPlatform();
|
const osType = distribution.getPlatform();
|
||||||
const archiveType = getDownloadArchiveExtension();
|
const archiveType = getDownloadArchiveExtension();
|
||||||
const url = expectedUrl
|
const url = expectedUrl.replace('{{OS_TYPE}}', osType).replace('{{ARCHIVE_TYPE}}', archiveType);
|
||||||
.replace('{{OS_TYPE}}', osType)
|
|
||||||
.replace('{{ARCHIVE_TYPE}}', archiveType);
|
|
||||||
expect(result.url).toBe(url);
|
expect(result.url).toBe(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -98,7 +63,7 @@ describe('findPackageForDownload', () => {
|
|||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
||||||
|
|
||||||
const version = '18';
|
const version = '17';
|
||||||
const distro = new OracleDistribution({
|
const distro = new OracleDistribution({
|
||||||
version,
|
version,
|
||||||
architecture: '', // to get default value
|
architecture: '', // to get default value
|
||||||
@ -112,11 +77,10 @@ describe('findPackageForDownload', () => {
|
|||||||
}
|
}
|
||||||
const archiveType = getDownloadArchiveExtension();
|
const archiveType = getDownloadArchiveExtension();
|
||||||
const result = await distro['findPackageForDownload'](version);
|
const result = await distro['findPackageForDownload'](version);
|
||||||
const expectedUrl = `https://download.oracle.com/java/18/archive/jdk-18_${osType}-${distroArch}_bin.${archiveType}`;
|
const expectedUrl = `https://download.oracle.com/java/17/latest/jdk-17_${osType}-${distroArch}_bin.${archiveType}`;
|
||||||
|
|
||||||
expect(result.url).toBe(expectedUrl);
|
expect(result.url).toBe(expectedUrl);
|
||||||
},
|
}
|
||||||
10000
|
|
||||||
);
|
);
|
||||||
|
|
||||||
it('should throw an error', async () => {
|
it('should throw an error', async () => {
|
||||||
@ -126,5 +90,8 @@ describe('findPackageForDownload', () => {
|
|||||||
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
||||||
/Oracle JDK is only supported for JDK 17 and later/
|
/Oracle JDK is only supported for JDK 17 and later/
|
||||||
);
|
);
|
||||||
|
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
|
||||||
|
/Could not find Oracle JDK for SemVer */
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -1,294 +0,0 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import {SapMachineDistribution} from '../../src/distributions/sapmachine/installer';
|
|
||||||
import * as utils from '../../src/util';
|
|
||||||
|
|
||||||
import manifestData from '../data/sapmachine.json';
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient.mockReturnValue({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData
|
|
||||||
});
|
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
|
||||||
utils,
|
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
const mockPlatform = (
|
|
||||||
distribution: SapMachineDistribution,
|
|
||||||
platform: string
|
|
||||||
) => {
|
|
||||||
distribution['getPlatformOption'] = () => platform;
|
|
||||||
const mockedExtension = platform == 'windows' ? 'zip' : 'tar.gz';
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('shouldFallbackToBackupUrl', () => {
|
|
||||||
it('should return correct release when the primary URL is not available', async () => {
|
|
||||||
spyHttpClient.mockReturnValueOnce({
|
|
||||||
statusCode: 404,
|
|
||||||
headers: {},
|
|
||||||
result: ''
|
|
||||||
});
|
|
||||||
spyHttpClient.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData
|
|
||||||
});
|
|
||||||
|
|
||||||
const version = '17';
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: version,
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
mockPlatform(distribution, 'linux');
|
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
|
||||||
version
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
|
||||||
expect(availableVersion.url).toBe(
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
it.each([
|
|
||||||
['11', 'x64', 'linux', 71],
|
|
||||||
['11', 'aarch64', 'linux', 54],
|
|
||||||
['17', 'riscv', 'linux', 0],
|
|
||||||
['16.0.1', 'x64', 'linux', 71],
|
|
||||||
['23-ea', 'x64', 'linux', 798],
|
|
||||||
['23-ea', 'aarch64', 'windows', 0],
|
|
||||||
['23-ea', 'x64', 'windows', 750]
|
|
||||||
])(
|
|
||||||
'should get right number of available versions from JSON',
|
|
||||||
async (
|
|
||||||
jdkVersion: string,
|
|
||||||
arch: string,
|
|
||||||
platform: string,
|
|
||||||
len: number
|
|
||||||
) => {
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
|
||||||
expect(availableVersions).not.toBeNull();
|
|
||||||
expect(availableVersions.length).toBe(len);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_linux-aarch64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_windows-x64_bin.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11.0.17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.17/sapmachine-jdk-11.0.17_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-aarch64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_windows-x64_bin.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.4',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.4.1/sapmachine-jdk-17.0.4.1_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jre',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'jre',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_linux-aarch64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'jre',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_windows-x64_bin.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.4',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jre',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.4.1/sapmachine-jre-17.0.4.1_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'23-ea',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-23%2B15/sapmachine-jdk-23-ea.15_linux-x64_bin.tar.gz',
|
|
||||||
'23'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'21.0.2+2-ea',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.2%2B2/sapmachine-jdk-21.0.2-ea.2_linux-x64_bin.tar.gz',
|
|
||||||
'21.0.2+2'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux-musl',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64-musl_bin.tar.gz'
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'should return proper link according to the specified java-version, platform and arch',
|
|
||||||
async (
|
|
||||||
version: string,
|
|
||||||
platform: string,
|
|
||||||
arch: string,
|
|
||||||
packageType: string,
|
|
||||||
expectedLink: string,
|
|
||||||
normalizedVersion: string = version
|
|
||||||
) => {
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: version,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
|
||||||
normalizedVersion
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['8', 'linux', 'x64'],
|
|
||||||
['8', 'macos', 'aarch64'],
|
|
||||||
['23', 'macos', 'aarch64'],
|
|
||||||
['17', 'linux', 'riscv'],
|
|
||||||
['23', 'linux', 'x64'],
|
|
||||||
['25-ea', 'linux', 'x64', '25'],
|
|
||||||
['8-ea', 'linux', 'x64', '8'],
|
|
||||||
['21.0.3+7', 'linux', 'x64', '21.0.3+7'],
|
|
||||||
['21.0.3+8-ea', 'linux', 'x64', '21.0.3+8'],
|
|
||||||
['17', 'linux-muse', 'aarch64']
|
|
||||||
])(
|
|
||||||
'should throw when required version of JDK can not be found in the JSON',
|
|
||||||
async (
|
|
||||||
version: string,
|
|
||||||
platform: string,
|
|
||||||
arch: string,
|
|
||||||
normalizedVersion: string = version
|
|
||||||
) => {
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: version,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](normalizedVersion)
|
|
||||||
).rejects.toThrow(
|
|
||||||
`Couldn't find any satisfied version for the specified java-version: "${normalizedVersion}" and architecture: "${arch}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('should throw when required package type is not supported', async () => {
|
|
||||||
const jdkVersion = '17';
|
|
||||||
const arch = 'x64';
|
|
||||||
const platform = 'linux';
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk+fx',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](jdkVersion)
|
|
||||||
).rejects.toThrow(
|
|
||||||
'SapMachine provides only the `jdk` and `jre` package type'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,287 +0,0 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
|
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
|
||||||
import {SemeruDistribution} from '../../src/distributions/semeru/installer';
|
|
||||||
|
|
||||||
import manifestData from '../data/semeru.json';
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient.mockReturnValue({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: []
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'build correct url for %s',
|
|
||||||
async (installerOptions: JavaInstallerOptions, expectedParameters) => {
|
|
||||||
const distribution = new SemeruDistribution(installerOptions);
|
|
||||||
const baseUrl =
|
|
||||||
'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
|
||||||
const expectedUrl = `${baseUrl}?project=jdk&vendor=ibm&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
|
||||||
distribution['getPlatformOption'] = () => 'mac';
|
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
|
||||||
|
|
||||||
expect(spyHttpClient.mock.calls).toHaveLength(1);
|
|
||||||
expect(spyHttpClient.mock.calls[0][0]).toBe(expectedUrl);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('load available versions', async () => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient
|
|
||||||
.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData as any
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData as any
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: []
|
|
||||||
});
|
|
||||||
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
|
||||||
expect(availableVersions).not.toBeNull();
|
|
||||||
expect(availableVersions.length).toBe(manifestData.length * 2);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['jdk', 'Java_IBM_Semeru_jdk'],
|
|
||||||
['jre', 'Java_IBM_Semeru_jre']
|
|
||||||
])('find right toolchain folder', (packageType: string, expected: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// @ts-ignore - because it is protected
|
|
||||||
expect(distribution.toolcacheFolderName).toBe(expected);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
it.each([
|
|
||||||
['8', '8.0.322+6'],
|
|
||||||
['16', '16.0.2+7'],
|
|
||||||
['16.0', '16.0.2+7'],
|
|
||||||
['16.0.2', '16.0.2+7'],
|
|
||||||
['8.x', '8.0.322+6'],
|
|
||||||
['x', '17.0.2+8']
|
|
||||||
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
|
||||||
expect(resolvedVersion.version).toBe(expected);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('version is found but binaries list is empty', async () => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '9.0.8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload']('9.0.8')
|
|
||||||
).rejects.toThrow(/Could not find satisfied version for SemVer */);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('version is not found', async () => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '7.x',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
|
|
||||||
/Could not find satisfied version for SemVer */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('version list is empty', async () => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => [];
|
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
|
||||||
/Could not find satisfied version for SemVer */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each(['x64', 'x86', 'ppc64le', 'ppc64', 's390x', 'aarch64'])(
|
|
||||||
'correct Semeru `%s` architecture resolves',
|
|
||||||
async (arch: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload']('8');
|
|
||||||
expect(resolvedVersion.version).not.toBeNull();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['zos', 'z/OS', 'z/os', 'test0987654321=', '++=++', 'myArch'])(
|
|
||||||
'incorrect Semeru `%s` architecture throws',
|
|
||||||
async (arch: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => [];
|
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
|
||||||
`Unsupported architecture for IBM Semeru: ${arch} for your current OS version, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['9-ea', '17-ea', '8-ea', '4-ea'])(
|
|
||||||
'early access version are illegal for Semeru (%s)',
|
|
||||||
async (version: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: version,
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](version)
|
|
||||||
).rejects.toThrow(
|
|
||||||
'IBM Semeru does not provide builds for early access versions'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
'jdk+fx',
|
|
||||||
'jre+fx',
|
|
||||||
'test',
|
|
||||||
'test2',
|
|
||||||
'jdk-fx',
|
|
||||||
'javafx',
|
|
||||||
'jdk-javafx',
|
|
||||||
'ibm',
|
|
||||||
' '
|
|
||||||
])(
|
|
||||||
'rejects incorrect `%s` Semeru package type',
|
|
||||||
async (packageType: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
|
||||||
'IBM Semeru only provide `jdk` and `jre` package types'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['jdk', 'jre'])(
|
|
||||||
'accepts correct `%s` Semeru package type',
|
|
||||||
async (packageType: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload']('8');
|
|
||||||
await expect(resolvedVersion.version).toMatch(/8[0-9.]+/);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('fails when long release name is used', async () => {
|
|
||||||
expect(
|
|
||||||
() =>
|
|
||||||
new SemeruDistribution({
|
|
||||||
version: 'jdk-16.0.2+7_openj9-0.27.1',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
})
|
|
||||||
).toThrow(
|
|
||||||
"The string 'jdk-16.0.2+7_openj9-0.27.1' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user