From 57001e52888647886778a3f12d94a64414553831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Dziedziul?= Date: Mon, 22 Jan 2024 19:41:08 +0100 Subject: [PATCH 1/2] Use a single definition of the supported JDK versions --- .github/workflows/build-pr.yml | 6 +++++- .github/workflows/ee-nlc-snapshot-push.yml | 6 +++++- .github/workflows/ee-nlc-tag-push.yml | 6 +++++- .github/workflows/ee_latest_snapshot_push.yml | 6 +++++- .github/workflows/get-supported-jdks.yaml | 15 +++++++++++++++ .github/workflows/oss_latest_snapshot_push.yml | 6 +++++- .github/workflows/tag_image_push.yml | 6 +++++- .github/workflows/tag_image_push_rhel.yml | 6 +++++- 8 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/get-supported-jdks.yaml diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index efc39ed1..cc916999 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -61,13 +61,17 @@ jobs: ${{ env.docker_log_file_oss }} ${{ env.docker_log_file_ee }} + jdks: + uses: ./.github/workflows/get-supported-jdks.yaml + build-pr-custom-jdk: runs-on: ubuntu-latest + needs: jdks name: Build with jdk-${{ matrix.jdk }} strategy: fail-fast: false matrix: - jdk: [ '17', '21' ] + jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }} steps: - name: Checkout Code uses: actions/checkout@v4 diff --git a/.github/workflows/ee-nlc-snapshot-push.yml b/.github/workflows/ee-nlc-snapshot-push.yml index 60163647..591ae042 100644 --- a/.github/workflows/ee-nlc-snapshot-push.yml +++ b/.github/workflows/ee-nlc-snapshot-push.yml @@ -13,12 +13,16 @@ env: test_container_name_ee: hazelcast-ee-test jobs: + jdks: + uses: ./.github/workflows/get-supported-jdks.yaml + push: runs-on: ubuntu-latest + needs: jdks strategy: fail-fast: false matrix: - jdk: [ '17', '21' ] + jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }} env: HZ_VERSION : ${{ github.event.inputs.HZ_VERSION }} NLC_REPOSITORY: ${{ secrets.NLC_REPOSITORY }} diff --git a/.github/workflows/ee-nlc-tag-push.yml b/.github/workflows/ee-nlc-tag-push.yml index 4a695900..4e826281 100644 --- a/.github/workflows/ee-nlc-tag-push.yml +++ b/.github/workflows/ee-nlc-tag-push.yml @@ -16,12 +16,16 @@ env: test_container_name_ee: hazelcast-ee-test jobs: + jdks: + uses: ./.github/workflows/get-supported-jdks.yaml + push: runs-on: ubuntu-latest + needs: jdks strategy: fail-fast: false matrix: - jdk: [ '17', '21' ] + jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }} env: NLC_REPOSITORY: ${{ secrets.NLC_REPOSITORY }} NLC_REPO_USERNAME: ${{ secrets.NLC_REPO_USERNAME }} diff --git a/.github/workflows/ee_latest_snapshot_push.yml b/.github/workflows/ee_latest_snapshot_push.yml index d81edbae..2b777c97 100644 --- a/.github/workflows/ee_latest_snapshot_push.yml +++ b/.github/workflows/ee_latest_snapshot_push.yml @@ -13,11 +13,15 @@ env: test_container_name_ee: hazelcast-ee-test jobs: + jdks: + uses: ./.github/workflows/get-supported-jdks.yaml + push: runs-on: ubuntu-latest + needs: jdks strategy: matrix: - jdk: [ '17', '21' ] + jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }} variant: [ 'slim','' ] include: - variant: slim diff --git a/.github/workflows/get-supported-jdks.yaml b/.github/workflows/get-supported-jdks.yaml new file mode 100644 index 00000000..daab0e20 --- /dev/null +++ b/.github/workflows/get-supported-jdks.yaml @@ -0,0 +1,15 @@ +name: Get supported JDKs + +on: + workflow_call: + outputs: + jdks: + value: ${{ jobs.get-supported-jdks.outputs.jdks }} + +jobs: + get-supported-jdks: + runs-on: ubuntu-latest + outputs: + jdks: "['17', '21']" + steps: + - run: exit 0 \ No newline at end of file diff --git a/.github/workflows/oss_latest_snapshot_push.yml b/.github/workflows/oss_latest_snapshot_push.yml index c37f761e..4f841c38 100644 --- a/.github/workflows/oss_latest_snapshot_push.yml +++ b/.github/workflows/oss_latest_snapshot_push.yml @@ -13,12 +13,16 @@ env: test_container_name_oss: hazelcast-oss-test jobs: + jdks: + uses: ./.github/workflows/get-supported-jdks.yaml + push: runs-on: ubuntu-latest + needs: jdks strategy: fail-fast: false matrix: - jdk: [ '17', '21' ] + jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }} variant: [ 'slim','' ] include: - variant: slim diff --git a/.github/workflows/tag_image_push.yml b/.github/workflows/tag_image_push.yml index 71da3ef8..a827f5a6 100644 --- a/.github/workflows/tag_image_push.yml +++ b/.github/workflows/tag_image_push.yml @@ -28,11 +28,15 @@ env: test_container_name_ee: hazelcast-ee-test jobs: + jdks: + uses: ./.github/workflows/get-supported-jdks.yaml + push: runs-on: ubuntu-latest + needs: jdks strategy: matrix: - jdk: [ '17', '21' ] + jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }} variant: [ 'slim','' ] include: - variant: slim diff --git a/.github/workflows/tag_image_push_rhel.yml b/.github/workflows/tag_image_push_rhel.yml index 94b5039c..1a918ad0 100644 --- a/.github/workflows/tag_image_push_rhel.yml +++ b/.github/workflows/tag_image_push_rhel.yml @@ -16,6 +16,9 @@ on: description: 'Version of the docker image e.g. 5.1.1, 5.1.1-1, defaults to HZ_VERSION' required: false jobs: + jdks: + uses: ./.github/workflows/get-supported-jdks.yaml + build: defaults: run: @@ -34,10 +37,11 @@ jobs: PROJECT_NAME: test-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.jdk }} runs-on: ubuntu-latest + needs: jdks strategy: fail-fast: false matrix: - jdk: [ '17', '21' ] + jdk: ${{ fromJSON(needs.jdks.outputs.jdks) }} steps: - name: Set HZ version as environment variable run: | From 941c71f3f97b6793e74c87472abdd65d930b3fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Dziedziul?= Date: Mon, 22 Jan 2024 19:42:03 +0100 Subject: [PATCH 2/2] Use a single definition of the supported JDK versions - add missing newline --- .github/workflows/get-supported-jdks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/get-supported-jdks.yaml b/.github/workflows/get-supported-jdks.yaml index daab0e20..bee8bc6f 100644 --- a/.github/workflows/get-supported-jdks.yaml +++ b/.github/workflows/get-supported-jdks.yaml @@ -12,4 +12,4 @@ jobs: outputs: jdks: "['17', '21']" steps: - - run: exit 0 \ No newline at end of file + - run: exit 0