From 1eb32b9d80911269f0665326bb72199ae08715c8 Mon Sep 17 00:00:00 2001 From: Peter Nied Date: Wed, 2 Mar 2022 22:37:42 +0000 Subject: [PATCH] Use adoptjdk and support building in one jdk and testing in another Following example from: https://github.com/opensearch-project/common-utils/pull/121 Signed-off-by: Peter Nied --- .github/workflows/ci.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc6daea185..0ceb171100 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,20 @@ jobs: steps: - - name: Set up JDK - uses: actions/setup-java@v1 + - name: Set up JDK for build + if: ${{ matrix.jdk }} != 17 + uses: actions/setup-java@v2 with: + distribution: temurin # Temurin is a distribution of adoptium java-version: ${{ matrix.jdk }} + - name: Set up build for JDK17 to use JKD11 + if: ${{ matrix.jdk }} == 17 + uses: actions/setup-java@v2 + with: + distribution: temurin # Temurin is a distribution of adoptium + java-version: 11 + - name: Checkout security uses: actions/checkout@v2 @@ -43,7 +52,13 @@ jobs: - name: Checkstyle run: ./gradlew clean checkstyleMain checkstyleTest - - name: Package + - name: Set up JDK for test + uses: actions/setup-java@v2 + with: + distribution: temurin # Temurin is a distribution of adoptium + java-version: ${{ matrix.jdk }} + + - name: Run Tests run: ./gradlew clean build -Dbuild.snapshot=false -x test - name: Perform CodeQL Analysis