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

jianglongtao pushed a commit to branch fix-33341
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git

commit 09fe0061a97416e7124502e603201f5ce4254ebb
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Wed Sep 4 11:44:43 2024 +0800

    Add : add dispatch action for ci
---
 .github/workflows/workflow-dispatch-ci.yml         | 128 +++++++++++++++++++++
 .../workflows/workflow-dispatch-e2e-operation.yml  |  76 ++++++++++++
 .github/workflows/workflow-dispatch-e2e-sql.yml    |   1 +
 3 files changed, 205 insertions(+)

diff --git a/.github/workflows/workflow-dispatch-ci.yml 
b/.github/workflows/workflow-dispatch-ci.yml
new file mode 100644
index 00000000000..e5a76762330
--- /dev/null
+++ b/.github/workflows/workflow-dispatch-ci.yml
@@ -0,0 +1,128 @@
+#
+# 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: Workflow Dispatch - CI
+
+on:  # once a day. UTC time
+  workflow_dispatch:
+
+env:
+  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3
+  DEPENDENCY_PATH: $HOME/.m2/dbplus-engine-honor/${{ github.ref_name 
}}/repository/
+
+jobs:
+  global-environment:
+    name: Import Global Environment
+    uses: ./.github/workflows/required-reusable.yml
+
+  ci:
+    if: github.repository == 'SphereEx/dbplus-engine-honor'
+    name: CI - JDK ${{ matrix.java-version }} on ${{ matrix.os }}
+    needs: global-environment
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 90
+    strategy:
+      max-parallel: 20
+      fail-fast: false
+      matrix:
+        os: [ self-hosted-honor ]
+        java-version: [ 11, 17, 21, 22 ]
+    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: ${{ matrix.java-version }}
+      - uses: actions/cache@v4
+        with:
+          path: ~/.m2/repository/dbplus-engine-honor/${{ github.ref_name 
}}/repository/
+          key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-cache-${{ github.sha }}
+          restore-keys: |
+            ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-cache-
+            ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-
+      - name: Build Project with Maven
+        run: ./mvnw clean install -B -ntp -T1C -Dmaven.repo.local=${{ 
env.DEPENDENCY_PATH }}
+      - name: Build Examples with Maven
+        run: ./mvnw clean package -B -f examples/pom.xml -T1C 
-Dmaven.repo.local=${{ env.DEPENDENCY_PATH }}
+  
+  ci-jdk8:
+    if: github.repository == 'SphereEx/dbplus-engine-honor'
+    name: CI - JDK 8 on ${{ matrix.os }}
+    needs: global-environment
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 90
+    strategy:
+      max-parallel: 20
+      fail-fast: false
+      matrix:
+        os: [ self-hosted-honor ]
+    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
+      - uses: actions/cache@v4
+        with:
+          path: ~/.m2/repository/dbplus-engine-honor/${{ github.ref_name 
}}/repository/
+          key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-cache-${{ github.sha }}
+          restore-keys: |
+            ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-cache-
+            ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-
+      - name: Build prod with Maven
+        run: ./mvnw clean install -DskipTests -B -ntp -T1C 
-Dmaven.repo.local=${{ env.DEPENDENCY_PATH }}
+      - name: Setup JDK 8 for Test
+        uses: actions/setup-java@v4
+        with:
+          distribution: 'temurin'
+          java-version: 8
+      - name: Run Tests with JDK 8
+        run: ./mvnw test -B -ntp -fae -T1C -Dmaven.repo.local=${{ 
env.DEPENDENCY_PATH }}
+
+  ci-native-test:
+    if: github.repository == 'apache/shardingsphere'
+    name: NativeTest CI - GraalVM CE on ${{ matrix.os }}
+    needs: global-environment
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 90
+    strategy:
+      max-parallel: 20
+      fail-fast: false
+      matrix:
+        os: [ ubuntu-latest ]
+    steps:
+      - uses: actions/checkout@v4
+      - uses: graalvm/setup-graalvm@v1
+        with:
+          java-version: '21.0.2'
+          distribution: 'graalvm-community'
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+      - uses: actions/cache@v4
+        with:
+          path: ~/.m2/repository/dbplus-engine-honor/${{ github.ref_name 
}}/repository/
+          key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-cache-${{ github.sha }}
+          restore-keys: |
+            ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-cache-
+            ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-
+      - name: Run nativeTest with GraalVM CE
+        run: ./mvnw -PnativeTestInShardingSphere -T1C -e clean test
diff --git a/.github/workflows/workflow-dispatch-e2e-operation.yml 
b/.github/workflows/workflow-dispatch-e2e-operation.yml
new file mode 100644
index 00000000000..95fca2299b9
--- /dev/null
+++ b/.github/workflows/workflow-dispatch-e2e-operation.yml
@@ -0,0 +1,76 @@
+#
+# 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: Workflow Dispatch - E2E Operation
+
+on:
+  workflow_dispatch:
+
+concurrency:
+  group: e2e-pipeline-${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+env:
+  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3 -Dspotless.apply.skip=true 
-Dfailsafe.skipAfterFailureCount=1 -Dio.netty.leakDetectionLevel=advanced
+  DEPENDENCY_PATH: $HOME/.m2/dbplus-engine-honor/${{ github.ref_name 
}}/repository/
+
+jobs:
+  global-environment:
+    name: Import Global Environment
+    uses: ./.github/workflows/required-reusable.yml
+
+  e2e-operation-job:
+    if: github.repository == 'SphereEx/dbplus-engine-honor'
+    name: E2E - ${{ matrix.operation }} on ${{ matrix.image.version }}
+    needs: global-environment
+    runs-on: self-hosted-honor
+    strategy:
+      max-parallel: 20
+      fail-fast: false
+      matrix:
+        operation: [ transaction, pipeline, showprocesslist ]
+        image: [ { type: "it.docker.mysql.version", version: 
"mysql:5.7,mysql:8.0" }, { type: "it.docker.postgresql.version", version: 
"postgres:10-alpine,postgres:11-alpine,postgres:12-alpine,postgres:13-alpine,postgres:14-alpine"
 }, { type: "it.docker.opengauss.version", version: 
"enmotech/opengauss:2.1.0,enmotech/opengauss:3.0.0" }, { type: 
"it.docker.mariadb.version", version: "mariadb:11" } ]
+        exclude:
+          - operation: transaction
+            image: { type: "it.docker.mariadb.version", version: "mariadb:11" }
+          - operation: showprocesslist
+            image: { type: "it.docker.postgresql.version", version: 
"postgres:10-alpine,postgres:11-alpine,postgres:12-alpine,postgres:13-alpine,postgres:14-alpine"
 }
+          - operation: showprocesslist
+            image: { type: "it.docker.opengauss.version", version: 
"enmotech/opengauss:2.1.0,enmotech/opengauss:3.0.0" }
+          - operation: showprocesslist
+            image: { type: "it.docker.mariadb.version", version: "mariadb:11" }
+    timeout-minutes: 40
+    steps:
+      - name: Checkout Project
+        uses: actions/checkout@v4
+      - name: Retrieve Maven Caches
+        uses: actions/cache@v4
+        with:
+          path: ~/.m2/repository/dbplus-engine-honor/${{ github.ref_name 
}}/repository/
+          key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-e2e-cache-${{ github.sha }}
+          restore-keys: |
+            ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-e2e-cache-
+            ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX 
}}-maven-third-party-
+      - name: Setup JDK 11
+        uses: actions/setup-java@v4
+        with:
+          distribution: 'temurin'
+          java-version: 11
+      - name: Build ${{ matrix.operation }} E2E Image
+        run: ./mvnw -B clean install -am -pl test/e2e/operation/${{ 
matrix.operation }} -Pit.env.docker -DskipTests -Dmaven.repo.local=${{ 
env.DEPENDENCY_PATH }}
+      - name: Run ${{ matrix.operation }} on ${{ matrix.image.version }}
+        run: ./mvnw -nsu -B install -f test/e2e/operation/${{ matrix.operation 
}}/pom.xml -D${{ matrix.operation }}.it.env.type=docker -D${{ matrix.operation 
}}.${{ matrix.image.type }}=${{ matrix.image.version }} -Dmaven.repo.local=${{ 
env.DEPENDENCY_PATH }}
diff --git a/.github/workflows/workflow-dispatch-e2e-sql.yml 
b/.github/workflows/workflow-dispatch-e2e-sql.yml
index 1df79db4dcc..6736eaef7d7 100644
--- a/.github/workflows/workflow-dispatch-e2e-sql.yml
+++ b/.github/workflows/workflow-dispatch-e2e-sql.yml
@@ -35,6 +35,7 @@ jobs:
     uses: ./.github/workflows/required-reusable.yml
 
   build-e2e-image:
+    if: github.repository == 'SphereEx/dbplus-engine-honor'
     name: Build E2E Image
     needs: global-environment
     runs-on: self-hosted-honor

Reply via email to