Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for java.version file #23

Draft
wants to merge 51 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1fbc280
log versions
e-korolevskii Nov 17, 2022
4966150
build
e-korolevskii Nov 17, 2022
d5d37d4
build
e-korolevskii Nov 17, 2022
680565b
build
e-korolevskii Nov 17, 2022
8dcd17f
parse version
e-korolevskii Nov 24, 2022
71a377d
prettier log err
e-korolevskii Nov 24, 2022
af8b898
clean string
e-korolevskii Nov 24, 2022
c86f786
clean contents
e-korolevskii Nov 24, 2022
c77138c
coerce
e-korolevskii Nov 24, 2022
d4cd9e2
parseversion
e-korolevskii Nov 24, 2022
5a37903
ver parse
e-korolevskii Nov 24, 2022
f8c67ed
install version from file
e-korolevskii Nov 24, 2022
7bad438
await install
e-korolevskii Nov 24, 2022
5162a56
retry logic
e-korolevskii Nov 24, 2022
4a04cfa
rigth major version
e-korolevskii Nov 24, 2022
d0a3b38
update version splitter
e-korolevskii Nov 24, 2022
a4d7bf0
added debug
e-korolevskii Nov 24, 2022
53d9cbe
Merge branch 'main' into Add-support-for-java.version-file
e-korolevskii Nov 24, 2022
e2c0285
remove unused import
e-korolevskii Nov 24, 2022
50a9869
update regExp
e-korolevskii Nov 29, 2022
d00ebda
build
e-korolevskii Nov 29, 2022
6d0f35f
format & build
e-korolevskii Nov 29, 2022
4098751
docs changed
e-korolevskii Dec 1, 2022
4f2a9f7
update readme
e-korolevskii Dec 1, 2022
0986179
build
e-korolevskii Dec 5, 2022
5e09f33
add java-version-file input
e-korolevskii Dec 7, 2022
c91175d
docs changes
e-korolevskii Dec 7, 2022
e1d88bf
e2e tests
e-korolevskii Dec 7, 2022
1c29312
fix tests
e-korolevskii Dec 7, 2022
c69760f
add input in action
e-korolevskii Dec 7, 2022
1e74ea6
code format
e-korolevskii Dec 7, 2022
5a85bfb
build
e-korolevskii Dec 7, 2022
43f5042
change version match logic
e-korolevskii Dec 8, 2022
d1dae85
upd docs
e-korolevskii Dec 8, 2022
0143667
update tests
e-korolevskii Dec 8, 2022
f68f88a
format & build
e-korolevskii Dec 8, 2022
95a0d31
remove correto
e-korolevskii Dec 8, 2022
78a90d3
remove lib from tests
e-korolevskii Dec 8, 2022
26b4abc
smaller tests matrix
e-korolevskii Dec 8, 2022
d28f3e2
fix review points
e-korolevskii Dec 8, 2022
c13e4b1
fix review points
e-korolevskii Dec 8, 2022
291b946
fix review points
e-korolevskii Dec 8, 2022
a2ae828
build
e-korolevskii Dec 8, 2022
10d2aa6
rebuild
e-korolevskii Dec 8, 2022
a7975de
Add fix for major coretto version and ea. (#1)
dmitry-shibanov Dec 9, 2022
189d966
Update README.md
e-korolevskii Dec 9, 2022
527ec20
build
e-korolevskii Dec 9, 2022
79dc4b7
remove build
e-korolevskii Dec 9, 2022
41998c2
rebuild
e-korolevskii Dec 9, 2022
a18ba6f
Merge branch 'main' into Add-support-for-java.version-file
e-korolevskii Dec 9, 2022
4a0fd14
rebuild dist
dmitry-shibanov Dec 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 96 additions & 1 deletion .github/workflows/e2e-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,4 +254,99 @@ jobs:
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
shell: bash

# Only Microsoft provides AArch64. However, GitHub-hosted runners do not support this architecture.
setup-java-version-both-version-inputs-presents:
name: ${{ matrix.distribution }} version (should be from input) - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft', 'corretto' ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create .java-version file
shell: bash
run: echo "8" > .java-version
- name: setup-java
uses: ./
id: setup-java
with:
distribution: ${{ matrix.distribution }}
java-version: 11
java-version-file: '.java-version'
- name: Verify Java
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
shell: bash

setup-java-version-from-file-major-notation:
name: ${{ matrix.distribution }} version from file X - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft' ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create .java-version file
shell: bash
run: echo "11" > .java-version
- name: setup-java
uses: ./
id: setup-java
with:
distribution: ${{ matrix.distribution }}
java-version-file: '.java-version'
- name: Verify Java
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
shell: bash

setup-java-version-from-file-major-minor-patch-notation:
name: ${{ matrix.distribution }} version from file X.Y.Z - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
distribution: [ 'adopt', 'adopt-openj9', 'zulu' ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create .java-version file
shell: bash
run: echo "11.0.2" > .java-version
- name: setup-java
uses: ./
id: setup-java
with:
distribution: ${{ matrix.distribution }}
java-version-file: '.java-version'
- name: Verify Java
run: bash __tests__/verify-java.sh "11.0.2" "${{ steps.setup-java.outputs.path }}"
shell: bash

setup-java-version-from-file-major-minor-patch-with-dist:
name: ${{ matrix.distribution }} version from file 'openjdk64-11.0.2' - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
distribution: ['adopt', 'adopt-openj9', 'zulu', 'liberica', ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Create .java-version file
shell: bash
run: echo "openjdk64-11.0.2" > .java-version
- name: setup-java
uses: ./
id: setup-java
with:
distribution: ${{ matrix.distribution }}
java-version-file: '.java-version'
- name: Verify Java
run: bash __tests__/verify-java.sh "11.0.2" "${{ steps.setup-java.outputs.path }}"
shell: bash
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ This action allows you to work with Java and Scala projects.

## Usage

- `java-version`: _(required)_ The Java version to set up. Takes a whole or [semver](#supported-version-syntax) Java version.
- `java-version`: The Java version to 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 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).

Expand Down
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ author: 'GitHub'
inputs:
java-version:
description: 'The Java version to set up. Takes a whole or semver Java version. See examples of supported syntax in README file'
required: true
java-version-file:
description: 'The path to the `.java-version` file. See examples of supported syntax in README file'
distribution:
description: 'Java distribution. See the list of supported distributions in README file'
required: true
Expand Down
Loading