mirror of
https://github.com/actions/setup-java.git
synced 2026-10-06 14:33:10 +01:00
Support Java release tags with exact abbreviated builds
Normalize jdk-prefixed numeric versions and pad abbreviated build requests so exact build constraints survive version matching. Keep platform and package validation consistent, document the syntax, and add regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -191,6 +191,17 @@ describe('convertVersionToSemver', () => {
|
||||
|
||||
describe('normalizeJavaVersionToSemver', () => {
|
||||
it.each([
|
||||
['jdk-27+35', '27.0.0+35'],
|
||||
['27+35', '27.0.0+35'],
|
||||
['27.0+35', '27.0.0+35'],
|
||||
['jdk-27.0+35', '27.0.0+35'],
|
||||
['jdk-27.0.0+35', '27.0.0+35'],
|
||||
['jdk-27', '27'],
|
||||
['jdk-27.0', '27.0'],
|
||||
['jdk-27.0.1', '27.0.1'],
|
||||
['27+35.0.LTS', '27.0.0+35.0.LTS'],
|
||||
['jdk-26.0.2.1+1', '26.0.2+1.1'],
|
||||
['jdk-11.0.9.1', '11.0.9+1'],
|
||||
['17', '17'],
|
||||
['17.0.8', '17.0.8'],
|
||||
['17.0.8+7', '17.0.8+7'],
|
||||
@@ -199,7 +210,11 @@ describe('normalizeJavaVersionToSemver', () => {
|
||||
['26.0.2.1+1', '26.0.2+1.1'],
|
||||
['17.0.8.1+1080.1', '17.0.8+1.1080.1'],
|
||||
['>=11.0.9.1', '>=11.0.9.1'],
|
||||
['17.x', '17.x']
|
||||
['17.x', '17.x'],
|
||||
['>=17 <28', '>=17 <28'],
|
||||
['jdk-27.x', 'jdk-27.x'],
|
||||
['jdk-latest', 'jdk-latest'],
|
||||
['temurin-27+35', 'temurin-27+35']
|
||||
])('%s -> %s', (input: string, expected: string) => {
|
||||
expect(normalizeJavaVersionToSemver(input)).toBe(expected);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user