Skip to content

Commit

Permalink
Use adoptjdk and support building in one jdk and testing in another
Browse files Browse the repository at this point in the history
Following example from: opensearch-project/common-utils#121

Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Mar 2, 2022
1 parent 7d48e9a commit 1eb32b9
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit 1eb32b9

Please sign in to comment.