From be9c2104f81003455135e93461b2d90f3a3486f4 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Sat, 10 Aug 2024 16:59:43 +0800 Subject: [PATCH] Force to build on JDK 17+ --- .github/workflows/graalvm.yml | 1 + .github/workflows/maven.yml | 37 +++++++++++++++++++++++----- .github/workflows/required-check.yml | 3 +++ pom.xml | 6 ++--- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index 1216b9307f..f57cd810d4 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -28,6 +28,7 @@ on: jobs: build: + if: github.repository == 'apache/shardingsphere-elasticjob' strategy: matrix: java: [ '22.0.2' ] diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8bc9771b26..a40824b1bb 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,23 +26,22 @@ on: jobs: build: + if: github.repository == 'apache/shardingsphere-elasticjob' strategy: matrix: - java: [ 8, 17, 21, 22 ] + java: [ 17, 21, 22 ] os: [ 'windows-latest', 'macos-latest', 'ubuntu-latest' ] - runs-on: ${{ matrix.os }} - steps: - name: Configure Git if: matrix.os == 'windows-latest' run: | git config --global core.longpaths true - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: - distribution: 'zulu' + distribution: 'temurin' java-version: ${{ matrix.java }} cache: 'maven' - name: Build with Maven in Windows @@ -60,3 +59,29 @@ jobs: file: '**/target/site/jacoco/jacoco.xml' - name: Build Examples with Maven run: ./mvnw clean package -B -f examples/pom.xml -T1C + ci-jdk8: + if: github.repository == 'apache/shardingsphere-elasticjob' + name: CI - JDK 8 on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + steps: + - name: Support Long Paths in Windows + if: matrix.os == 'windows-latest' + run: git config --global core.longpaths true + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 11 + cache: 'maven' + - name: Build prod with Maven + run: ./mvnw clean install -DskipTests -B -e -T1C + - name: Setup JDK 8 for Test + uses: actions/setup-java@v4 + with: + distribution: 'zulu' + java-version: 8 + - name: Run Tests with JDK 8 + run: ./mvnw test -B -e -T1C diff --git a/.github/workflows/required-check.yml b/.github/workflows/required-check.yml index 229dc8df41..5fc8817524 100644 --- a/.github/workflows/required-check.yml +++ b/.github/workflows/required-check.yml @@ -28,6 +28,7 @@ concurrency: jobs: check-checkstyle: + if: github.repository == 'apache/shardingsphere-elasticjob' name: Check - CheckStyle runs-on: ubuntu-latest timeout-minutes: 10 @@ -37,6 +38,7 @@ jobs: run: ./mvnw checkstyle:check -Pcheck -T1C check-spotless: + if: github.repository == 'apache/shardingsphere-elasticjob' name: Check - Spotless runs-on: ubuntu-latest timeout-minutes: 10 @@ -46,6 +48,7 @@ jobs: run: ./mvnw spotless:check -Pcheck -T1C check-license: + if: github.repository == 'apache/shardingsphere-elasticjob' name: Check - License runs-on: ubuntu-latest timeout-minutes: 10 diff --git a/pom.xml b/pom.xml index 15a3aa9ca4..c01cdbe81d 100644 --- a/pom.xml +++ b/pom.xml @@ -755,14 +755,14 @@ [11,) + + 8 + maven-surefire-plugin - - @{argLine} --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -