This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch ci
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git

commit 36500318178b12955233a11daec3267350436aa6
Author: kezhenxu94 <[email protected]>
AuthorDate: Tue Jun 21 21:38:15 2022 +0800

    Improve CI jobs to reduce waiting time
---
 .github/workflows/backend.yml | 157 +++++++++++++++++++++++++++---------------
 1 file changed, 103 insertions(+), 54 deletions(-)

diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml
index 7e196a909..fefb8f94e 100644
--- a/.github/workflows/backend.yml
+++ b/.github/workflows/backend.yml
@@ -3,13 +3,13 @@
 # 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 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,
+# 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.
@@ -29,33 +29,84 @@ concurrency:
   cancel-in-progress: true
 
 jobs:
-  build-on-ubuntu:
-    name: Build-on-ubuntu
+  license-header:
+    if: github.repository == 'apache/incubator-seatunnel'
+    name: License header
     runs-on: ubuntu-latest
+    timeout-minutes: 10
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          submodules: true
+      - name: Check license header
+        uses: apache/skywalking-eyes@985866ce7e324454f61e22eb2db2e998db09d6f3
+
+  code-style:
+    if: github.repository == 'apache/incubator-seatunnel'
+    name: Code style
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          submodules: true
+      - name: Check code style
+        run: ./mvnw --batch --quiet --no-snapshot-updates clean 
checkstyle:check
+
+  dependency-license:
+    if: github.repository == 'apache/incubator-seatunnel'
+    name: Dependency licenses
+    runs-on: ubuntu-latest
+    timeout-minutes: 30
+    steps:
+      - uses: actions/checkout@v3
+        with:
+          submodules: true
+      - uses: actions/setup-java@v3
+        with:
+          distribution: 'temurin'
+          java-version: '8'
+          cache: 'maven'
+      - uses: actions/download-artifact@v3
+        with:
+          name: dist
+          path: dist
+      - name: Check Dependencies Licenses
+        run: tools/dependencies/check-LICENSE.sh
+
+  sanity-check:
+    if: github.repository == 'apache/incubator-seatunnel'
+    name: Sanity check results
+    needs: [ license-header, dependency-license, code-style ]
+    runs-on: ubuntu-latest
+    timeout-minutes: 10
+    steps:
+      - name: Check results
+        run: |
+          [[ ${{ needs.dependency-license.result }} == 'success' ]] || exit 1;
+          [[ ${{ needs.license-header.result }} == 'success' ]] || exit 1;
+          [[ ${{ needs.code-style.result }} == 'success' ]] || exit 1;
+
+  build:
+    if: github.repository == 'apache/incubator-seatunnel'
+    name: Build
+    needs: [ sanity-check ]
     strategy:
       matrix:
-        java: ['8', '11']
-    timeout-minutes: 50
-    env:
-      MAVEN_OPTS: -Xmx2G -Xms2G
+        java: [ '8', '11' ]
+        os: [ 'ubuntu-latest', 'windows-latest' ]
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 30
     steps:
-      - uses: actions/checkout@v2
-      - name: Set up JDK ${{ matrix.java }}
-        uses: actions/setup-java@v2
+      - uses: actions/checkout@v3
         with:
-          java-version:  ${{ matrix.java }}
-          distribution: 'adopt'
-      - name: Cache local Maven repository
-        uses: actions/cache@v2
+          submodules: true
+      - uses: actions/setup-java@v3
         with:
-          path: ~/.m2/repository
-          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
-          restore-keys: |
-            ${{ runner.os }}-maven-
-      - name: Check Style
-        run: |
-          ./mvnw -T 2C -B checkstyle:check --no-snapshot-updates
-      - name: Build and Package
+          distribution: 'temurin'
+          java-version: ${{ matrix.java }}
+          cache: 'maven'
+      - name: Build distribution tar
         run: |
           ./mvnw -B install scalastyle:check \
                  -Dmaven.test.skip=true \
@@ -66,47 +117,45 @@ jobs:
                  -Dmaven.wagon.http.retryHandler.count=3 \
                  -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 \
                  --no-snapshot-updates
-      - name: Check dependency license
-        run: bash ./tools/dependencies/checkLicense.sh
+
+  unit-test:
+    name: Unit Test
+    runs-on: ${{ matrix.os }}
+    needs: [ sanity-check ]
+    strategy:
+      matrix:
+        java: [ '8', '11' ]
+        os: [ 'ubuntu-latest', 'windows-latest' ]
+    timeout-minutes: 50
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up JDK ${{ matrix.java }}
+        uses: actions/setup-java@v3
+        with:
+          java-version: ${{ matrix.java }}
+          distribution: 'temurin'
+          cache: 'maven'
       - name: Run Unit tests
         run: |
           ./mvnw -T 2C -B clean verify -Dmaven.test.skip=false 
-Dcheckstyle.skip=true -Dscalastyle.skip=true -Dlicense.skipAddThirdParty=true 
--no-snapshot-updates
-      - name: Run Integration tests
-        run: |
-          ./mvnw -T 2C -B verify -DskipUT=true -DskipIT=false 
-Dcheckstyle.skip=true -Dscalastyle.skip=true -Dlicense.skipAddThirdParty=true 
--no-snapshot-updates
-  build-on-windows:
-    name: Build-on-windows
-    runs-on: windows-latest
+
+  integration-test:
+    name: Integration Test
+    runs-on: ${{ matrix.os }}
+    needs: [ sanity-check ]
     strategy:
       matrix:
-        java: ['8']
+        java: [ '8', '11' ]
+        os: [ 'ubuntu-latest', 'windows-latest' ]
     timeout-minutes: 50
-    env:
-      MAVEN_OPTS: -Xmx2G -Xms2G
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v2
       - name: Set up JDK ${{ matrix.java }}
         uses: actions/setup-java@v3
         with:
-          java-version:  ${{ matrix.java }}
+          java-version: ${{ matrix.java }}
           distribution: 'temurin'
           cache: 'maven'
-      - name: Cache local Maven repository
-        uses: actions/cache@v2
-        with:
-          path: ~/.m2/repository
-          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
-          restore-keys: |
-            ${{ runner.os }}-maven-
-      - name: Check Style
-        shell: cmd
-        run: |
-          .\mvnw.cmd -T 2C -B checkstyle:check -nsu
-      - name: Build and Package
-        shell: cmd
-        run: |
-          .\mvnw.cmd -B install scalastyle:check -Dmaven.test.skip=true 
-Dcheckstyle.skip=true -Dlicense.skipAddThirdParty=true -Dhttp.keepAlive=false 
-Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.count=3 
-Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -nsu
-      - name: Run Unit tests
-        shell: cmd
+      - name: Run Integration tests
         run: |
-          .\mvnw.cmd -T 2C -B clean verify -Dmaven.test.skip=false 
-Dcheckstyle.skip=true -Dscalastyle.skip=true -Dlicense.skipAddThirdParty=true 
-nsu
+          ./mvnw -T 2C -B verify -DskipUT=true -DskipIT=false 
-Dcheckstyle.skip=true -Dscalastyle.skip=true -Dlicense.skipAddThirdParty=true 
--no-snapshot-updates

Reply via email to