diff --git a/.github/workflows/ci-template.yaml b/.github/workflows/ci-template.yaml new file mode 100644 index 0000000000..f6676aa5fc --- /dev/null +++ b/.github/workflows/ci-template.yaml @@ -0,0 +1,79 @@ +################################################################################ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ + +# .github/workflows/ci-template.yaml +name: CI Template + +on: + workflow_call: + inputs: + java-version: + required: true + type: string + maven-parameters: + description: "Any parameters of the Maven command." + required: false + type: string + default: "" +jobs: + build: + runs-on: self-hosted + strategy: + fail-fast: false + matrix: + module: [ core, flink ] + name: "${{ matrix.module }}" + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: ${{ inputs.java-version }} + distribution: 'temurin' + - name: Build + run: | + mvn -T 1C -B clean install -DskipTests + - name: Test + timeout-minutes: 60 + run: | + TEST_MODULES=$(./.github/workflows/stage.sh ${{ matrix.module }}) + echo "github ref: ${{ github.ref }}" + echo "Start testing modules: $TEST_MODULES" + mvn -B verify $TEST_MODULES -Ptest-coverage -Ptest-${{ matrix.module }} -Dlog.dir=${{ runner.temp }}/fluss-logs -Dlog4j.configurationFile=${{ github.workspace }}/tools/ci/log4j.properties ${{ inputs.maven-parameters }} + env: + MAVEN_OPTS: -Xmx4096m + ARTIFACTS_OSS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_ENDPOINT }} + ARTIFACTS_OSS_REGION: ${{ secrets.ARTIFACTS_OSS_REGION }} + ARTIFACTS_OSS_BUCKET: ${{ secrets.ARTIFACTS_OSS_BUCKET }} + ARTIFACTS_OSS_ACCESS_KEY: ${{ secrets.ARTIFACTS_OSS_ACCESS_KEY }} + ARTIFACTS_OSS_SECRET_KEY: ${{ secrets.ARTIFACTS_OSS_SECRET_KEY }} + ARTIFACTS_OSS_STS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_STS_ENDPOINT }} + ARTIFACTS_OSS_ROLE_ARN: ${{ secrets.ARTIFACTS_OSS_ROLE_ARN }} + - name: Upload build logs + uses: actions/upload-artifact@v4 + if: ${{ failure() }} + with: + name: logs-test-${{ matrix.module }}-${{ github.run_number}}#${{ github.run_attempt }} + path: ${{ runner.temp }}/fluss-logs/* + - name: Upload JaCoCo coverage report + uses: actions/upload-artifact@v4 + if: ${{ success() && github.ref == 'refs/heads/main' }} + with: + name: jacoco-report-${{ matrix.module }}-${{ github.run_number}}#${{ github.run_attempt }} + path: ${{ github.workspace }}/fluss-test-coverage/target/site/jacoco-aggregate/* \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f706a2552d..54ce0d0775 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,52 +22,36 @@ on: - main - release-** - ci-** + paths-ignore: + - 'website/**' + - '**/*.md' pull_request: paths-ignore: - 'website/**' - '**/*.md' + concurrency: group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }} cancel-in-progress: true jobs: - build: - runs-on: self-hosted - strategy: - fail-fast: false - matrix: - module: [ core, flink ] + compile-on-jdk8: + name: "Compile Java 8" + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 + - name: Set up JDK 8 + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' - name: Build run: | - mvn -T 1C -B clean install -DskipTests - - name: Test - timeout-minutes: 60 - run: | - TEST_MODULES=$(./.github/workflows/stage.sh ${{ matrix.module }}) - echo "github ref: ${{ github.ref }}" - echo "Start testing modules: $TEST_MODULES" - mvn -B verify $TEST_MODULES -Ptest-coverage -Ptest-${{ matrix.module }} -Dlog.dir=${{ runner.temp }}/fluss-logs -Dlog4j.configurationFile=${{ github.workspace }}/tools/ci/log4j.properties - env: - MAVEN_OPTS: -Xmx4096m - ARTIFACTS_OSS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_ENDPOINT }} - ARTIFACTS_OSS_REGION: ${{ secrets.ARTIFACTS_OSS_REGION }} - ARTIFACTS_OSS_BUCKET: ${{ secrets.ARTIFACTS_OSS_BUCKET }} - ARTIFACTS_OSS_ACCESS_KEY: ${{ secrets.ARTIFACTS_OSS_ACCESS_KEY }} - ARTIFACTS_OSS_SECRET_KEY: ${{ secrets.ARTIFACTS_OSS_SECRET_KEY }} - ARTIFACTS_OSS_STS_ENDPOINT: ${{ secrets.ARTIFACTS_OSS_STS_ENDPOINT }} - ARTIFACTS_OSS_ROLE_ARN: ${{ secrets.ARTIFACTS_OSS_ROLE_ARN }} - - name: Upload build logs - uses: actions/upload-artifact@v4 - if: ${{ failure() }} - with: - name: logs-test-${{ matrix.module }}-${{ github.run_number}}#${{ github.run_attempt }} - path: ${{ runner.temp }}/fluss-logs/* - - name: Upload JaCoCo coverage report - uses: actions/upload-artifact@v4 - if: ${{ success() && github.ref == 'refs/heads/main' }} - with: - name: jacoco-report-${{ matrix.module }}-${{ github.run_number}}#${{ github.run_attempt }} - path: ${{ github.workspace }}/fluss-test-coverage/target/site/jacoco-aggregate/* \ No newline at end of file + mvn -T 1C -B clean install -DskipTests -Pjava8 + + build-on-jdk11: + name: "Java 11" + uses: ./.github/workflows/ci-template.yaml + with: + java-version: "11" \ No newline at end of file diff --git a/.github/workflows/license-check.yml b/.github/workflows/license-check.yml index a830abaee0..a54175d17a 100644 --- a/.github/workflows/license-check.yml +++ b/.github/workflows/license-check.yml @@ -37,7 +37,7 @@ jobs: - name: Set JDK uses: actions/setup-java@v4 with: - java-version: 8 + java-version: 11 distribution: 'temurin' - name: Build diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml new file mode 100644 index 0000000000..4836e10f5a --- /dev/null +++ b/.github/workflows/nightly.yaml @@ -0,0 +1,34 @@ +################################################################################ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ +name: Nightly +on: + schedule: + # Run at 20:00 UTC daily which is the lowest traffic time for Fluss project. + - cron: "0 20 * * *" + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }} + cancel-in-progress: true + +jobs: + build-on-jdk8: + name: "Java 8" + uses: ./.github/workflows/ci-template.yaml + with: + java-version: "8" + maven-parameters: "-Pjava8" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 8441ee50f3..c033ea79b8 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ UTF-8 UTF-8 - 1.8 + 11 ${target.java.version} ${target.java.version} **/*Test.* @@ -143,6 +143,25 @@ plugin executes before, the property is undefined and makes the tests fail. Thus we define an empty property here to make sure it doesn't fail. See also https://issues.apache.org/jira/browse/SUREFIRE-1431 --> + + -XX:+IgnoreUnrecognizedVMOptions + --add-opens=java.base/java.lang=ALL-UNNAMED + --add-opens=java.base/java.lang.invoke=ALL-UNNAMED + --add-opens=java.base/java.lang.reflect=ALL-UNNAMED + --add-opens=java.base/java.io=ALL-UNNAMED + --add-opens=java.base/java.net=ALL-UNNAMED + --add-opens=java.base/java.nio=ALL-UNNAMED + --add-opens=java.base/java.util=ALL-UNNAMED + --add-opens=java.base/java.util.concurrent=ALL-UNNAMED + --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED + --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED + --add-opens=java.base/sun.nio.ch=ALL-UNNAMED + --add-opens=java.base/sun.nio.cs=ALL-UNNAMED + --add-opens=java.base/sun.security.action=ALL-UNNAMED + --add-opens=java.base/sun.util.calendar=ALL-UNNAMED + -Djdk.reflect.useDirectMethodHandle=false + -Dio.netty.tryReflectionSetAccessible=true + @@ -425,6 +444,29 @@ + + java8 + + 1.8 + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${target.java.version} + ${target.java.version} + false + + + -Xpkginfo:always + + + + + + test-coverage @@ -510,6 +552,22 @@ org.apache.maven.plugins maven-compiler-plugin + 3.8.0 + + ${target.java.version} + ${target.java.version} + + false + + --add-exports=java.base/sun.net.util=ALL-UNNAMED + --add-exports=java.management/sun.management=ALL-UNNAMED + --add-exports=java.rmi/sun.rmi.registry=ALL-UNNAMED + --add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED + --add-exports=java.base/sun.nio.ch=ALL-UNNAMED + + -Xpkginfo:always + + @@ -639,7 +697,7 @@ dynamic - @{argLine} -Xms256m -Xmx2048m -XX:+UseG1GC + @{argLine} -Xms256m -Xmx2048m -XX:+UseG1GC ${extraJavaTestArgs} @@ -692,8 +750,8 @@ - - [3.1.1,) + + [3.8.6,) ${target.java.version} @@ -879,6 +937,7 @@ maven-compiler-plugin 3.8.0 + ${target.java.version} ${target.java.version}