Skip to content

Test Java client against the released IMDG servers #11

Test Java client against the released IMDG servers

Test Java client against the released IMDG servers #11

name: Test Java client against the released IMDG servers
on:
workflow_dispatch:
inputs:
organization_name:
description: Default is hazelcast, but if you would like to run the workflow with your forked repo, set your github username
required: true
default: hazelcast
branch_name:
description: Name of the branch to test client from
required: true
default: master
jobs:
setup_server_matrix:
name: Setup the server test matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Set server matrix
id: set-matrix
run: echo "matrix=$( python get_server_matrix.py )" >> "$GITHUB_OUTPUT"
test_client:
needs: [setup_server_matrix]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
server-version: ${{ fromJson(needs.setup_server_matrix.outputs.matrix) }}
kind: [ os, enterprise ]
os: [ ubuntu-latest ]
java: [ { version: 17, distribution: corretto },
{ version: 21, distribution: corretto },
{ version: 17, distribution: zulu },
{ version: 21, distribution: zulu },
{ version: 17, distribution: semeru },
{ version: 21, distribution: semeru },
{ version: 17, distribution: oracle },
{ version: 21, distribution: oracle },
{ version: 17, distribution: microsoft },
{ version: 21, distribution: microsoft },
{ version: 17, distribution: adopt-openj9 },
{ version: 21, distribution: adopt-openj9 }
]
name: Test Java client ${{ github.event.inputs.branch_name }} branch against ${{ matrix.kind }} ${{ matrix.server-version }} server on ${{ matrix.os }} and JVM ${{ matrix.java.version }} ${{ matrix.java.distribution }}
steps:
- name: Checkout to scripts
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java.version }}
distribution: ${{ matrix.java.distribution }}
- name: Checkout to ${{ github.event.inputs.branch_name }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.organization_name }}/hazelcast-java-client
token: ${{ secrets.GH_PAT }}
path: client
ref: ${{ github.event.inputs.branch_name }}
- name: Setup Local Maven Cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Check Server Version to Determine License Version
uses: madhead/semver-utils@latest
id: version
with:
version: ${{ matrix.server-version }}
compare-to: 5.3.0
- name: Set up HZ_LICENSEKEY env
if: ${{ matrix.kind == 'enterprise' }}
run: |
echo "HZ_LICENSEKEY=${{ '>' == steps.version.outputs.comparison-result && secrets.HAZELCAST_ENTERPRISE_KEY || secrets.HAZELCAST_ENTERPRISE_KEY_V5 }}" >> $GITHUB_ENV
- name: Run non-enterprise tests
shell: bash -l {0}
run: |
chmod +x mvnw
./mvnw -B -V -e install -Pintegration-tests -Pcode-coverage -Djdk.version=${{ matrix.java.version }} -Dtest.hazelcast-server.version=${{ matrix.server-version }}
working-directory: client/hazelcast-java-client
- name: Run enterprise tests
if: ${{ matrix.kind == 'enterprise' }}
shell: bash -l {0}
run: |
chmod +x mvnw
./mvnw -B -V -e test -Pintegration-tests -Pcode-coverage -Djdk.version=${{ matrix.java.version }} -Dtest.hazelcast-server.version=${{ matrix.server-version }}
working-directory: client/hazelcast-enterprise-java-client