Skip to content

Commit

Permalink
Move Java installation from apt-get to setup-java action
Browse files Browse the repository at this point in the history
In hazelcast/client-compatibility-suites#127 (comment) it was identified that using `apt-get` to install Java on GitHub runners can cause issues with Maven using the right JDK, and that using `setup-java` instead resolves that.

Fixes: hazelcast#1222 🤞
  • Loading branch information
JackPGreen committed Aug 7, 2024
1 parent a79e606 commit abb78c3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/java-config.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
JAVA_VERSION=11
JAVA_DISTRIBUTION=temurin
11 changes: 10 additions & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
- name: Install Necessary Packages
run: |
apt-get update
apt-get install -y build-essential cmake curl git libssl-dev maven net-tools openjdk-11-jre-headless gdb curl
apt-get install -y build-essential cmake curl git libssl-dev net-tools gdb curl
- name: Make sure the target architecture is 32 bit
run: |
Expand All @@ -215,6 +215,15 @@ jobs:
ref: ${{ needs.get-refs.outputs.ref }}
token: ${{ secrets.GH_TOKEN }}

- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV

- name: "Setup JDK"
uses: "actions/setup-java@v4"
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}

- name: Download hazelcast-enterprise-tests.jar
run: |
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/nightly-ubuntu-i386.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Install Necessary Packages
run: |
apt-get update
apt-get install -y build-essential cmake curl git libssl-dev maven net-tools openjdk-11-jre-headless gdb curl
apt-get install -y build-essential cmake curl git libssl-dev net-tools gdb curl
- name: Make sure the target architecture is 32 bit
run: |
Expand All @@ -60,6 +60,15 @@ jobs:
- uses: actions/checkout@v1

- name: Read Java Config
run: cat ${{ github.workspace }}/.github/java-config.env >> $GITHUB_ENV

- name: "Setup JDK"
uses: "actions/setup-java@v4"
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRIBUTION }}

- name: Download hazelcast-enterprise-tests.jar
run: |
curl -H "Authorization: token ${{ secrets.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-5.3.0-SNAPSHOT-tests.jar
Expand Down

0 comments on commit abb78c3

Please sign in to comment.