From 5f78ad00277ebadc00469ceb36c787ee6af4f2e4 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Mon, 12 Aug 2024 10:55:20 +0800 Subject: [PATCH] Block `elasticjob-test-native` module from compiling on JDK 8 to JDK16 --- .github/workflows/graalvm.yml | 3 ++- .github/workflows/maven.yml | 7 +++---- .github/workflows/required-check.yml | 3 +++ .../configuration/graalvm-native-image.cn.md | 4 ++-- .../configuration/graalvm-native-image.en.md | 4 ++-- pom.xml | 3 --- test/native/pom.xml | 3 ++- test/pom.xml | 14 +++++++++++++- 8 files changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index b396737ff6..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' ] @@ -45,4 +46,4 @@ jobs: native-image-job-reports: 'true' - name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }} continue-on-error: true - run: ./mvnw -PnativeTestInElasticJob -T1C -B -e -Dspring-boot-dependencies.version=3.3.2 clean test + run: ./mvnw -PnativeTestInElasticJob -T1C -B -e clean test diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 8bc9771b26..9f1c5bbfb3 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -26,21 +26,20 @@ on: jobs: build: + if: github.repository == 'apache/shardingsphere-elasticjob' strategy: matrix: java: [ 8, 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' java-version: ${{ matrix.java }} diff --git a/.github/workflows/required-check.yml b/.github/workflows/required-check.yml index 229dc8df41..4abcc4acfc 100644 --- a/.github/workflows/required-check.yml +++ b/.github/workflows/required-check.yml @@ -29,6 +29,7 @@ concurrency: jobs: check-checkstyle: name: Check - CheckStyle + if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -38,6 +39,7 @@ jobs: check-spotless: name: Check - Spotless + if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -47,6 +49,7 @@ jobs: check-license: name: Check - License + if: github.repository == 'apache/shardingsphere-elasticjob' runs-on: ubuntu-latest timeout-minutes: 10 steps: diff --git a/docs/content/user-manual/configuration/graalvm-native-image.cn.md b/docs/content/user-manual/configuration/graalvm-native-image.cn.md index 79ca6f43bc..560c0f2123 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.cn.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.cn.md @@ -256,7 +256,7 @@ sudo apt-get install build-essential zlib1g-dev -y git clone git@github.com:apache/shardingsphere-elasticjob.git cd ./shardingsphere-elasticjob/ -./mvnw -PnativeTestInElasticJob -T1C -e -Dspring-boot-dependencies.version=3.3.2 clean test +./mvnw -PnativeTestInElasticJob -T1C -e clean test ``` 当贡献者发现缺少与 ElasticJob 无关的第三方库的 GraalVM Reachability Metadata 时,应当在 @@ -285,5 +285,5 @@ ElasticJob 定义了 `generateMetadata` 的 Maven Profile 用于在 GraalVM JIT ```bash git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C -Dspring-boot-dependencies.version=3.3.2 clean test native:metadata-copy +./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy ``` diff --git a/docs/content/user-manual/configuration/graalvm-native-image.en.md b/docs/content/user-manual/configuration/graalvm-native-image.en.md index fb86d608e0..4353929cb2 100644 --- a/docs/content/user-manual/configuration/graalvm-native-image.en.md +++ b/docs/content/user-manual/configuration/graalvm-native-image.en.md @@ -259,7 +259,7 @@ sudo apt-get install build-essential zlib1g-dev -y git clone git@github.com:apache/shardingsphere-elasticjob.git cd ./shardingsphere-elasticjob/ -./mvnw -PnativeTestInElasticJob -T1C -e -Dspring-boot-dependencies.version=3.3.2 clean test +./mvnw -PnativeTestInElasticJob -T1C -e clean test ``` When contributors find that GraalVM Reachability Metadata for third-party libraries not related to ElasticJob is missing, @@ -289,5 +289,5 @@ contributors should place it in the classpath of the shardingsphere-test-native ```bash git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C -Dspring-boot-dependencies.version=3.3.2 clean test native:metadata-copy +./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy ``` diff --git a/pom.xml b/pom.xml index 4bc966d9de..9231ff2dc8 100644 --- a/pom.xml +++ b/pom.xml @@ -757,9 +757,6 @@ [11,) - - 8 - diff --git a/test/native/pom.xml b/test/native/pom.xml index 1370b8b48b..d031f4f768 100644 --- a/test/native/pom.xml +++ b/test/native/pom.xml @@ -28,7 +28,8 @@ true - + + 3.3.2 2.0.13 1.5.6 diff --git a/test/pom.xml b/test/pom.xml index 4d6d5e326f..460ae982d4 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -30,6 +30,18 @@ e2e util - native + + + + + jdk17+ + + [17,) + + + native + + +