From deb2e0538bb89c40c6d4e651c572b2bd1b51af4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 22:08:54 +0800 Subject: [PATCH 01/10] Trigger GitHub Action --- .github/workflows/ci.yml | 44 ++++++++++++++++------------------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50b6bc565d366..b4ebb0d1a0689 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,32 +57,22 @@ jobs: global-environment: name: Import Global Environment uses: ./.github/workflows/required-reusable.yml - - ci: - if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} - name: CI - Compile by JDK 11 and Run on JDK 8 - needs: global-environment + + send-failure-message: + name: Send Failure Message runs-on: ubuntu-latest - timeout-minutes: 30 + timeout-minutes: 25 + if: always() steps: - - uses: actions/checkout@v3 - - name: Setup JDK 11 for Build - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Build Project with Maven - run: ./mvnw clean install -B -ntp -DskipTests -T1C - - name: Setup JDK 8 for Test - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 8 - - name: Run Tests with JDK 8 - run: ./mvnw install -T1C -B -ntp -fae + - name: Send Failure Message + timeout-minutes: 5 + env: + ACTIONS_FEISHU_TAG: 'v1.3.1' + INPUT_WEBHOOK: "${{ secrets.FEISHU_ROBOT_NIGHTLY_BUILD }}" + INPUT_MESSAGE_TYPE: "post" + INPUT_TITLE: "Warning" + INPUT_CONTENT: "The CI job failed. Please check the log for details." + run: | + wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz + tar zxf linux-amd64-actions-feishu.tar.gz feishu + ./feishu \ No newline at end of file From 7c9a37f8600a2ed2c3e539ad2d6499c9ac65cf9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 22:09:32 +0800 Subject: [PATCH 02/10] Trigger GitHub Action --- .github/workflows/e2e-agent.yml | 115 ---------- .github/workflows/e2e-operation.yml | 109 --------- .github/workflows/e2e-sql.yml | 154 ------------- .github/workflows/nightly-build.yml | 239 -------------------- .github/workflows/nightly-check.yml | 195 ---------------- .github/workflows/nightly-ci.yml | 101 --------- .github/workflows/nightly-e2e-operation.yml | 73 ------ .github/workflows/nightly-sql-parser.yml | 66 ------ .github/workflows/required-check.yml | 65 ------ .github/workflows/required-reusable.yml | 68 ------ .github/workflows/schedule-report.yml | 61 ----- 11 files changed, 1246 deletions(-) delete mode 100644 .github/workflows/e2e-agent.yml delete mode 100644 .github/workflows/e2e-operation.yml delete mode 100644 .github/workflows/e2e-sql.yml delete mode 100644 .github/workflows/nightly-build.yml delete mode 100644 .github/workflows/nightly-check.yml delete mode 100644 .github/workflows/nightly-ci.yml delete mode 100644 .github/workflows/nightly-e2e-operation.yml delete mode 100644 .github/workflows/nightly-sql-parser.yml delete mode 100644 .github/workflows/required-check.yml delete mode 100644 .github/workflows/required-reusable.yml delete mode 100644 .github/workflows/schedule-report.yml diff --git a/.github/workflows/e2e-agent.yml b/.github/workflows/e2e-agent.yml deleted file mode 100644 index c47be81a2eda0..0000000000000 --- a/.github/workflows/e2e-agent.yml +++ /dev/null @@ -1,115 +0,0 @@ -# -# 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: E2E - Agent - -on: - push: - branches: [ dev ] - paths: - - '.github/workflows/e2e-agent.yml' - - '**/pom.xml' - - '**/src/main/**' - - '!test/**' - - 'test/pom.xml' - - 'test/e2e/agent/**' - - '!distribution/**' - - 'distribution/proxy/**' - - 'distribution/jdbc/**' - - '!examples/**' - - '!*.md' - pull_request: - branches: [ master ] - paths: - - '.github/workflows/e2e-agent.yml' - - '**/pom.xml' - - '**/src/main/**' - - '!test/**' - - 'test/pom.xml' - - 'test/e2e/agent/**' - - '!distribution/**' - - 'distribution/proxy/**' - - 'distribution/jdbc/**' - - '!examples/**' - - '!*.md' - workflow_dispatch: - -concurrency: - group: e2e-${{ 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 - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - agent-mysql: - if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} - name: E2E - Agent with MySQL - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - max-parallel: 20 - fail-fast: false - matrix: - include: - - adapter: proxy - feature: tracing - plugin: jaeger - - adapter: proxy - feature: tracing - plugin: zipkin - - adapter: proxy - feature: metrics - plugin: prometheus - - adapter: proxy - feature: logging - plugin: file - - adapter: jdbc - feature: logging - plugin: file - - adapter: jdbc - feature: metrics - plugin: prometheus - - adapter: jdbc - feature: tracing - plugin: jaeger - - adapter: jdbc - feature: tracing - plugin: zipkin - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Build Project - run: - ./mvnw -B clean install -DskipITs -DskipTests -Prelease - - name: Run E2E Test - run: - ./mvnw -B clean install -f test/e2e/agent/plugins/${{ matrix.feature }}/${{ matrix.plugin }}/pom.xml -Dspotless.apply.skip=true -Dit.env.adapter=${{ matrix.adapter }} -Dit.env.type=${{ matrix.plugin }} -Pit.env.${{ matrix.adapter }}.${{ matrix.plugin }} diff --git a/.github/workflows/e2e-operation.yml b/.github/workflows/e2e-operation.yml deleted file mode 100644 index b08ff3d2bd4ed..0000000000000 --- a/.github/workflows/e2e-operation.yml +++ /dev/null @@ -1,109 +0,0 @@ -# -# 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: E2E - Operation - -on: - push: - branches: [ dev ] - pull_request: - workflow_dispatch: - -concurrency: - group: e2e-${{ 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 - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - detect-changed-files: - name: Detect Changed Files - runs-on: ubuntu-latest - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: dorny/paths-filter@v2 - id: filter - with: - token: ${{ github.token }} - filters: .github/workflows/resources/filter/filters.yml - outputs: - changed_operations: ${{ steps.filter.outputs.changes }} - - e2e-operation: - if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} - name: E2E - ${{ matrix.operation }} on ${{ matrix.image.version }} - needs: [ detect-changed-files, global-environment ] - runs-on: ubuntu-latest - timeout-minutes: 40 - strategy: - max-parallel: 20 - fail-fast: false - matrix: - operation: [ transaction, pipeline, showprocesslist ] - image: [ { type: "it.docker.mysql.version", version: "mysql:5.7" }, { type: "it.docker.postgresql.version", version: "postgres:12-alpine" }, { type: "it.docker.opengauss.version", version: "enmotech/opengauss:2.1.0" } ] - exclude: - - operation: showprocesslist - image: { type: "it.docker.postgresql.version", version: "postgres:12-alpine" } - - operation: showprocesslist - image: { type: "it.docker.opengauss.version", version: "enmotech/opengauss:2.1.0" } - steps: - - env: - changed_operations: ${{ needs.detect-changed-files.outputs.changed_operations }} - current_operation: ${{ matrix.operation }} - name: Check if ${{ matrix.operation }} is Changed - run: | - echo "skip_current_step=false" >> $GITHUB_ENV - if [[ ${changed_operations} == '["ignore"]' ]]; then - echo "${current_operation} is ignored by ignore filter" - echo "skip_current_step=true" >> $GITHUB_ENV - fi - - if [[ ${changed_operations} == *""$current_operation""* ]]; then - echo "${current_operation} is detected by changed filter" - else - echo "${current_operation} is ignore by filter" - echo "skip_current_step=true" >> $GITHUB_ENV - fi - - name: Checkout Project - if: (env.skip_current_step == 'false') - uses: actions/checkout@v3 - - name: Retrieve Maven Caches - if: (env.skip_current_step == 'false') - uses: actions/cache@v3 - with: - path: ~/.m2/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- - - if: (env.skip_current_step == 'false') - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - name: Build ${{ matrix.operation }} E2E Image - if: (env.skip_current_step == 'false') - run: ./mvnw -B clean install -am -pl test/e2e/operation/${{ matrix.operation }} -Pit.env.docker -DskipTests - - name: Run ${{ matrix.operation }} on ${{ matrix.image.version }} - if: (env.skip_current_step == 'false') - 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 }} diff --git a/.github/workflows/e2e-sql.yml b/.github/workflows/e2e-sql.yml deleted file mode 100644 index 1cf68951a921d..0000000000000 --- a/.github/workflows/e2e-sql.yml +++ /dev/null @@ -1,154 +0,0 @@ -# -# 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: E2E - SQL - -on: - push: - branches: [ dev ] - paths: - - '.github/workflows/e2e-sql.yml' - - '**/pom.xml' - - '**/src/main/**' - - '!examples/**' - - '!distribution/**' - - 'distribution/proxy/**' - - '!distribution/proxy/src/main/release-docs/**' - - '!kernel/data-pipeline/**' - - '!test/**' - - 'test/pom.xml' - - 'test/e2e/fixture/**' - - 'test/e2e/env/**' - - 'test/e2e/sql/**' - - '!*.md' - pull_request: - branches: [ master ] - paths: - - '.github/workflows/e2e-sql.yml' - - '**/pom.xml' - - '**/src/main/**' - - '!examples/**' - - '!distribution/**' - - 'distribution/proxy/**' - - '!distribution/proxy/src/main/release-docs/**' - - '!kernel/data-pipeline/**' - - '!test/**' - - 'test/pom.xml' - - 'test/e2e/fixture/**' - - 'test/e2e/env/**' - - 'test/e2e/sql/**' - - '!*.md' - workflow_dispatch: - -concurrency: - group: e2e-${{ 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 - SEGMENT_DOWNLOAD_TIMEOUT_MINS: 1 - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - build-e2e-image: - name: Build E2E Image - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 20 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.m2/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: Build E2E Image - run: ./mvnw -B clean install -am -pl test/e2e/sql -Pit.env.docker -DskipTests -Dspotless.apply.skip=true - - name: Save E2E Image - run: docker save -o /tmp/${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-proxy-test.tar apache/shardingsphere-proxy-test:latest - - uses: actions/upload-artifact@v3 - with: - name: e2e-image - path: /tmp/${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-proxy-test.tar - retention-days: 10 - - e2e-sql: - name: E2E - SQL - needs: [ build-e2e-image, global-environment ] - if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} - runs-on: ubuntu-latest - timeout-minutes: 15 - strategy: - max-parallel: 20 - fail-fast: false - matrix: - adapter: [ proxy, jdbc ] - mode: [ Standalone, Cluster ] - database: [ MySQL, PostgreSQL ] - # Fix me #25051 - #scenario: [ dbtbl_with_readwrite_splitting, dbtbl_with_readwrite_splitting_and_encrypt, sharding_and_encrypt, encrypt_and_readwrite_splitting, encrypt_shadow, readwrite_splitting_and_shadow, sharding_and_shadow, sharding_encrypt_shadow, mask_encrypt, mask_sharding, mask_encrypt_sharding ] - scenario: [ empty_rules, rdl_empty_rules, passthrough, db, tbl, encrypt, readwrite_splitting, shadow, mask, dbtbl_with_readwrite_splitting_and_encrypt, sharding_and_encrypt, encrypt_and_readwrite_splitting, encrypt_shadow, readwrite_splitting_and_shadow, sharding_and_shadow, sharding_encrypt_shadow, mask_encrypt, mask_sharding, mask_encrypt_sharding ] - additional-options: [ '' ] - include: - - adapter: proxy - database: MySQL - scenario: passthrough - additional-options: '-Dmysql-connector-java.version=8.0.31' - exclude: - - adapter: jdbc - scenario: passthrough - - adapter: jdbc - mode: Cluster - - adapter: proxy - mode: Standalone - scenario: empty_rules - - adapter: proxy - mode: Standalone - scenario: rdl_empty_rules - - adapter: proxy - mode: Standalone - scenario: passthrough - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-e2e-cache-${{ github.sha }} - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - name: Download E2E Image - if: matrix.adapter == 'proxy' - uses: actions/download-artifact@v3 - with: - name: e2e-image - path: /tmp/ - - name: Load E2E Image - if: matrix.adapter == 'proxy' - run: docker load -i /tmp/${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-proxy-test.tar - - name: Run E2E Test - run: ./mvnw -nsu -B install -f test/e2e/sql/pom.xml -Dspotless.apply.skip=true -Dit.cluster.env.type=DOCKER -Dit.cluster.adapters=${{ matrix.adapter }} -Dit.run.modes=${{ matrix.mode }} -Dit.run.additional.cases=false -Dit.scenarios=${{ matrix.scenario }} -Dit.cluster.databases=${{ matrix.database }} ${{ matrix.additional-options }} diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml deleted file mode 100644 index 3a414ead7610b..0000000000000 --- a/.github/workflows/nightly-build.yml +++ /dev/null @@ -1,239 +0,0 @@ -# -# 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 - Build - -on: - schedule: - - cron: '0 16 */1 * *' # once a day. UTC time - workflow_dispatch: - inputs: - commit-id: - required: false - type: string - description: 'Commit ID to build. Default is the latest commit on the default branch.' - -env: - MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -DskipITs -DskipTests -Dspotless.apply.skip=true - HUB: ghcr.io/apache/shardingsphere - PROXY: ghcr.io/apache/shardingsphere-proxy - PROXY_NATIVE: ghcr.io/apache/shardingsphere-proxy-native - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - upload-to-nightlies: - if: github.repository == 'apache/shardingsphere' - name: Upload to Nightly Builds - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/cache@v3 - with: - path: ~/.m2/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- - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - name: Build Project - run: | - ./mvnw -B clean install -Prelease - - uses: burnett01/rsync-deployments@5.2 - with: - switches: -avzr - path: distribution/proxy/target/apache-shardingsphere-*.tar.gz - remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/shardingsphere - remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} - remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} - remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} - remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} - - build-proxy-image: - if: github.repository == 'apache/shardingsphere' - name: Build Proxy Image - needs: global-environment - runs-on: ${{ needs.global-environment.outputs.GLOBAL_RUNS_ON }} - permissions: - contents: read - packages: write - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ inputs.commit-id }} - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.m2/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: Login Container Registry - uses: docker/login-action@v2 - with: - registry: ${{ env.HUB }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - uses: docker/setup-qemu-action@v1 - - uses: docker/setup-buildx-action@v1 - - name: Push Docker Image - run: ./mvnw -am -pl distribution/proxy -B -Prelease,docker.buildx.push -DskipTests -Dproxy.image.repository=${{ env.PROXY }} -Dproxy.image.tag=${{ github.sha }} clean install - - build-proxy-native-image: - if: github.repository == 'apache/shardingsphere' - name: Build GraalVM Native Image - timeout-minutes: 90 - permissions: - contents: read - packages: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ inputs.commit-id }} - - uses: graalvm/setup-graalvm@v1 - with: - java-version: '17.0.8' - distribution: 'graalvm-community' - github-token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/cache@v3 - with: - path: ~/.m2/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- - - uses: docker/login-action@v2 - with: - registry: ${{ env.HUB }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Push Docker Image - run: | - ./mvnw -PgenerateStandardMetadata -DskipNativeTests -B -T1C clean test - ./mvnw -am -pl distribution/proxy-native -Prelease.native,docker.buildx.push.native -B -T1C -DskipTests -Dproxy.image.repository=${{ env.PROXY_NATIVE }} -Dproxy.image.tag=${{ github.sha }} clean package - - build-cache: - if: ${{ needs.global-environment.outputs.GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE == 'true' }} - name: Build Project - needs: global-environment - runs-on: ${{ needs.global-environment.outputs.GLOBAL_RUNS_ON }} - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Build with Maven - run: ./mvnw -B -T1C -ntp clean install -DskipITs -DskipTests - - generate-and-test-examples: - name: Example-${{ matrix.feature }}-${{ matrix.framework }}-${{ matrix.mode }}-${{ matrix.transaction }} - if: github.repository == 'apache/shardingsphere' - needs: build-cache - runs-on: ubuntu-latest - timeout-minutes: 90 - strategy: - max-parallel: 20 - fail-fast: false - matrix: - feature: [ sharding, readwrite-splitting, encrypt, shadow, mask ] - framework: [ jdbc, spring-boot-starter-jdbc, spring-boot-starter-jpa, spring-boot-starter-mybatis, spring-namespace-jdbc, spring-namespace-jpa, spring-namespace-mybatis ] - mode: [ standalone, cluster-zookeeper ] - transaction: [ local, xa-atomikos, xa-narayana ] - exclude: - - feature: shadow - framework: spring-boot-starter-jpa - - feature: shadow - framework: spring-namespace-jpa - - transaction: xa-atomikos - mode: cluster-zookeeper - - transaction: xa-narayana - mode: cluster-zookeeper - - feature: sharding - framework: spring-boot-starter-mybatis - mode: standalone - transaction: xa-atomikos - - feature: sharding - framework: spring-boot-starter-mybatis - mode: standalone - transaction: xa-narayana - services: - mysql: - image: mysql:8.0.22 - env: - MYSQL_ROOT_PASSWORD: 123456 - ports: - - 3306:3306 - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - zookeeper: - image: zookeeper:3.6.3 - ports: - - 2181:2181 - options: --health-cmd="echo ruok | nc localhost 2181" --health-interval=10s --health-timeout=5s --health-retries=3 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Prepare Environments - run: sh .github/workflows/resources/scripts/nightly-build-example/init-mysql-container.sh - - name: Build with Maven - run: ./mvnw -B -T1C -ntp clean install -DskipITs -DskipTests - - name: Generate Examples - run: ./mvnw -B clean install -f examples/shardingsphere-jdbc-example-generator/pom.xml -Pexample-generator -Dmodes=${{ matrix.mode }} -Dtransactions=${{ matrix.transaction }} -Dfeatures=${{ matrix.feature }} -Dframeworks=${{ matrix.framework }} - - name: Test Examples - run : ./mvnw -B test -f examples/shardingsphere-jdbc-example-generator/target/generated-sources/shardingsphere-jdbc-sample/${{ matrix.feature }}--${{ matrix.framework }}--${{ matrix.mode }}--${{ matrix.transaction }}/pom.xml -Pexample-generator -Dexec.cleanupDaemonThreads=false - - name: Package Examples - run: | - cd examples/shardingsphere-jdbc-example-generator/target/generated-sources/shardingsphere-jdbc-sample/ - tar -czvf ${{ matrix.feature }}--${{ matrix.framework }}--${{ matrix.mode }}--${{ matrix.transaction }}.tar.gz ${{ matrix.feature }}--${{ matrix.framework }}--${{ matrix.mode }}--${{ matrix.transaction }} - - uses: burnett01/rsync-deployments@5.2 - with: - switches: -avzr - path: examples/shardingsphere-jdbc-example-generator/target/generated-sources/shardingsphere-jdbc-sample/${{ matrix.feature }}--${{ matrix.framework }}--${{ matrix.mode }}--${{ matrix.transaction }}.tar.gz - remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/shardingsphere/examples - remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }} - remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }} - remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }} - remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }} diff --git a/.github/workflows/nightly-check.yml b/.github/workflows/nightly-check.yml deleted file mode 100644 index da1c9f7632bbb..0000000000000 --- a/.github/workflows/nightly-check.yml +++ /dev/null @@ -1,195 +0,0 @@ -# -# 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 - Check - -on: - schedule: - - cron: '0 20 */1 * *' # 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 - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - check-spotbugs: - if: github.repository == 'apache/shardingsphere' - name: Check - SpotBugs - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Run SpotBugs - run: ./mvnw clean install spotbugs:check -Pcheck -T1C - - check-and-report-sonarcloud: - if: github.repository == 'apache/shardingsphere' - name: Check - SonarCloud - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 25 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Analyze with SonarCloud - env: - MAVEN_OPTS: "-XX:+UseG1GC -XX:InitialHeapSize=2g -XX:MaxHeapSize=6g -XX:+UseStringDeduplication" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} - run: ./mvnw -B clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_shardingsphere -DskipTests - - checkstyle-report-sonarcloud: - if: github.repository == 'apache/shardingsphere' - name: Checkstyle - SonarCloud - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 100 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Aggregate checkstyle report - run: | - export MAVEN_OPTS='-Xmx4g -Xms512m' - ./mvnw clean verify checkstyle:checkstyle-aggregate - - name: Upload checkstyle report to SonarCloud - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} - run: ./mvnw -B sonar:sonar -Dsonar.projectKey=apache_shardingsphere -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml - - check-dead-links: - if: github.repository == 'apache/shardingsphere' - name: Check - Dead Links - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - run: sudo npm install -g markdown-link-check@3.10.0 - - name: Check dead link - run: | - IGNORED_PATH_LIST=("./docs/document/themes" "./docs/community/content/powered-by" "./docs/blog/content/material" "./docs/blog/themes") - ignore_current_file=false - - for file in $(find . -name "*.md"); do - for ignored_path in ${IGNORED_PATH_LIST[@]} - do - if [[ $file =~ $ignored_path ]]; then - ignore_current_file=true - break - fi - done - if [[ $ignore_current_file == true ]]; then - ignore_current_file=false - continue - fi - echo "Checking $file" - markdown-link-check -c .github/workflows/resources/linkcheck/markdown-link-check.json -q "$file" - done - - check-codeql: - if: github.repository == 'apache/shardingsphere' - name: Check - CodeQL - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 100 - permissions: - actions: read - contents: read - security-events: write - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: java - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Install Project - run: ./mvnw clean install -DskipTests - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:java" - - check-stale: - if: github.repository == 'apache/shardingsphere' - name: Check - Stale Issues - runs-on: ubuntu-latest - timeout-minutes: 10 - permissions: - issues: write - pull-requests: write - steps: - - uses: actions/stale@v8 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-issue-stale: 30 - days-before-pr-stale: -1 - days-before-close: -1 - stale-issue-label: "stale" - operations-per-run: 1000 - remove-stale-when-updated: true - stale-issue-message: > - There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be - marked as stale. diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml deleted file mode 100644 index 3945b115811ba..0000000000000 --- a/.github/workflows/nightly-ci.yml +++ /dev/null @@ -1,101 +0,0 @@ -# -# 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 - CI - -on: - schedule: - - cron: '0 18 */1 * *' # 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 - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - ci: - if: github.repository == 'apache/shardingsphere' - 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: [ ubuntu-latest, macos-latest, windows-latest ] - java-version: [ 11, 17, 21-ea ] - steps: - - name: Support Long Paths in Windows - if: matrix.os == 'windows-latest' - run: git config --global core.longpaths true - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: ${{ matrix.java-version }} - - uses: actions/cache@v3 - with: - path: ~/.m2/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 - - name: Build Examples with Maven - run: ./mvnw clean package -B -f examples/pom.xml -T1C - - ci-jdk8: - if: github.repository == 'apache/shardingsphere' - 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: [ 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@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.m2/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 - - name: Setup JDK 8 for Test - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 8 - - name: Run Tests with JDK 8 - run: ./mvnw test -B -ntp -fae -T1C diff --git a/.github/workflows/nightly-e2e-operation.yml b/.github/workflows/nightly-e2e-operation.yml deleted file mode 100644 index 9f0519d4c9b8e..0000000000000 --- a/.github/workflows/nightly-e2e-operation.yml +++ /dev/null @@ -1,73 +0,0 @@ -# -# 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 - E2E Operation - -on: - schedule: - - cron: '0 21 */1 * *' # once a day. UTC time - 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 - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - e2e-operation-job: - if: ${{ needs.global-environment.outputs.GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE == 'true' }} - name: E2E - ${{ matrix.operation }} on ${{ matrix.image.version }} - needs: global-environment - runs-on: ${{ needs.global-environment.outputs.GLOBAL_RUNS_ON }} - 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" } ] - exclude: - - 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" } - timeout-minutes: 40 - steps: - - name: Checkout Project - uses: actions/checkout@v3 - - name: Retrieve Maven Caches - uses: actions/cache@v3 - with: - path: ~/.m2/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@v3 - 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 - - 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 }} diff --git a/.github/workflows/nightly-sql-parser.yml b/.github/workflows/nightly-sql-parser.yml deleted file mode 100644 index 617f4c11f2b43..0000000000000 --- a/.github/workflows/nightly-sql-parser.yml +++ /dev/null @@ -1,66 +0,0 @@ -# -# 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 - SQL parser loading from external cases - -on: - schedule: - - cron: '0 18 */1 * *' # 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 -Dspotless.apply.skip=true - RUNS_ON: ubuntu-latest - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - database-parse: - if: github.repository == 'apache/shardingsphere' - name: CI - SQL Parser - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 90 - strategy: - max-parallel: 20 - fail-fast: false - matrix: - database: [ mysql, postgresql ] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.m2/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 -T1C -B -ntp clean install - - name: Run SQL Parser - continue-on-error: true - run: ./mvnw -nsu -B install -f parser/sql/dialect/${{ matrix.database }}/pom.xml -Dsql.parser.external.it.enabled=true - - uses: actions/upload-artifact@v3 - with: - name: sql-report - path: /tmp/*.csv diff --git a/.github/workflows/required-check.yml b/.github/workflows/required-check.yml deleted file mode 100644 index 60d16a00234e9..0000000000000 --- a/.github/workflows/required-check.yml +++ /dev/null @@ -1,65 +0,0 @@ -# -# 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: Required - Check - -on: - pull_request: - branches: [ master ] - workflow_dispatch: - -concurrency: - group: check-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - check-checkstyle: - if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} - name: Check - CheckStyle - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v3 - - name: Run CheckStyle - run: ./mvnw checkstyle:check -Pcheck -T1C - - check-spotless: - if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} - name: Check - Spotless - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v3 - - name: Run Spotless - run: ./mvnw spotless:check -Pcheck -T1C - - check-license: - if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} - name: Check - License - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - uses: actions/checkout@v3 - - name: Run Apache Rat - run: ./mvnw apache-rat:check -Pcheck -T1C diff --git a/.github/workflows/required-reusable.yml b/.github/workflows/required-reusable.yml deleted file mode 100644 index a933eb7de3497..0000000000000 --- a/.github/workflows/required-reusable.yml +++ /dev/null @@ -1,68 +0,0 @@ -# -# 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. -# - -on: - workflow_call: - outputs: - GLOBAL_CACHE_PREFIX: - value: ${{ jobs.init-environment.outputs.GLOBAL_CACHE_PREFIX }} - GLOBAL_RUNS_ON: - value: ${{ jobs.init-environment.outputs.GLOBAL_RUNS_ON }} - GLOBAL_JOB_ENABLED: - value: ${{ jobs.init-environment.outputs.GLOBAL_JOB_ENABLED }} - GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE: - value: ${{ jobs.init-environment.outputs.GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE }} - -jobs: - init-environment: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - sparse-checkout: | - .github/workflows/resources/variables/ - - name: Setup Environment - id: import-variables - run: | - cat .github/workflows/resources/variables/env-variables.properties | while read line - do - echo ${line} >> $GITHUB_OUTPUT - done - echo "GLOBAL_REPOSITORY=${{ env.GLOBAL_REPOSITORY }}" - echo "DISABLE_CI=${{ env.DISABLE_CI }}" - GLOBAL_CACHE_PREFIX=$(echo '${{ env.GLOBAL_REPOSITORY }}' | sed 's/\//_/g') - echo "GLOBAL_CACHE_PREFIX=${GLOBAL_CACHE_PREFIX}" >> $GITHUB_OUTPUT - - name: Check If Job is Executable - id: check-job-executable - env: - JSON_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }} - shell: sh - run: | - GLOBAL_CACHE_PREFIX=$(echo '${{ steps.import-variables.outputs.GLOBAL_REPOSITORY }}' | sed 's/\//-/g') - echo "GLOBAL_CACHE_PREFIX=${GLOBAL_CACHE_PREFIX}" >> $GITHUB_OUTPUT - if [ ${{ toJSON(github.repository) }} = ${{ steps.import-variables.outputs.GLOBAL_REPOSITORY }} ]; then - echo "GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE=true" >> $GITHUB_OUTPUT - echo "GLOBAL_JOB_ENABLED=false" >> $GITHUB_OUTPUT - if [ -z "${{ steps.import-variables.outputs.DISABLE_CI }}"] || [ "${{ steps.import-variables.outputs.DISABLE_CI }}"=="false" ] ; then - echo "GLOBAL_JOB_ENABLED=true" >> $GITHUB_OUTPUT - fi - fi - outputs: - GLOBAL_RUNS_ON: ${{ steps.import-variables.outputs.GLOBAL_RUNS_ON }} - GLOBAL_JOB_ENABLED: ${{ steps.check-job-executable.outputs.GLOBAL_JOB_ENABLED }} - GLOBAL_CACHE_PREFIX: ${{ steps.check-job-executable.outputs.GLOBAL_CACHE_PREFIX }} - GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE: ${{ steps.check-job-executable.outputs.GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE }} diff --git a/.github/workflows/schedule-report.yml b/.github/workflows/schedule-report.yml deleted file mode 100644 index ea931496dc59a..0000000000000 --- a/.github/workflows/schedule-report.yml +++ /dev/null @@ -1,61 +0,0 @@ -# -# 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: Schedule - Report - -on: - schedule: - - cron: '0 */1 * * *' # every hour - 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 - -jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - - check-and-report-sonarcloud: - if: github.repository == 'apache/shardingsphere' - name: Check - SonarCloud - needs: global-environment - runs-on: ubuntu-latest - timeout-minutes: 40 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: 11 - - uses: actions/cache@v3 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - uses: actions/cache@v3 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- - - name: Analyze with SonarCloud - env: - MAVEN_OPTS: "-XX:+UseG1GC -XX:InitialHeapSize=2g -XX:MaxHeapSize=6g -XX:+UseStringDeduplication" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} - run: ./mvnw -B clean verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=apache_shardingsphere -DskipTests From 457a148c5401612179352fb65f6da1b3d32693e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 22:10:08 +0800 Subject: [PATCH 03/10] Trigger GitHub Action --- .github/workflows/ci.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4ebb0d1a0689..e676b0d247850 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,31 +19,6 @@ name: CI on: push: - branches: [ dev ] - paths: - - '.github/workflows/ci.yml' - - '**/pom.xml' - - '**/src/main/**' - - '**/src/test/**' - - '!distribution/**' - - 'test/it/**' - - '!test/e2e/**' - - 'test/e2e/driver/**' - - '!*.md' - pull_request: - branches: [ master ] - paths: - - '.github/workflows/ci.yml' - - '**/pom.xml' - - '**/src/main/**' - - '**/src/test/**' - - '!distribution/**' - - 'test/it/**' - - '!test/e2e/**' - - 'test/e2e/driver/**' - - '!*.md' - repository_dispatch: - types: ci-completed workflow_dispatch: concurrency: @@ -54,10 +29,6 @@ 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 jobs: - global-environment: - name: Import Global Environment - uses: ./.github/workflows/required-reusable.yml - send-failure-message: name: Send Failure Message runs-on: ubuntu-latest From 9f40939e90044d8473c9e783c1b200ea2d9ea6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 22:12:20 +0800 Subject: [PATCH 04/10] Trigger GitHub Action --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e676b0d247850..483a02bc9b023 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,4 +46,4 @@ jobs: run: | wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz tar zxf linux-amd64-actions-feishu.tar.gz feishu - ./feishu \ No newline at end of file + ./feishu From cf486ff1ba2af53f7175064208fc021d152152e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 22:15:27 +0800 Subject: [PATCH 05/10] Trigger GitHub Action --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 483a02bc9b023..f96112fe57e91 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,3 +47,4 @@ jobs: wget -q https://github.com/xiachufang/actions-feishu/releases/download/${{ env.ACTIONS_FEISHU_TAG }}/linux-amd64-actions-feishu.tar.gz tar zxf linux-amd64-actions-feishu.tar.gz feishu ./feishu + From 4725e196c398b2b082f5f658c07e0b5ae625c4e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 22:21:54 +0800 Subject: [PATCH 06/10] Trigger GitHub Action --- .github/workflows/required-check.yml | 65 +++++++++++++++++++++++ .github/workflows/required-reusable.yml | 68 +++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100644 .github/workflows/required-check.yml create mode 100644 .github/workflows/required-reusable.yml diff --git a/.github/workflows/required-check.yml b/.github/workflows/required-check.yml new file mode 100644 index 0000000000000..bc195e09d789f --- /dev/null +++ b/.github/workflows/required-check.yml @@ -0,0 +1,65 @@ +# +# 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: Required - Check + +on: + pull_request: + branches: [ master ] + workflow_dispatch: + +concurrency: + group: check-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + global-environment: + name: Import Global Environment + uses: ./.github/workflows/required-reusable.yml + + check-checkstyle: + if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} + name: Check - CheckStyle + needs: global-environment + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + - name: Run CheckStyle + run: ./mvnw checkstyle:check -Pcheck -T1C + + check-spotless: + if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} + name: Check - Spotless + needs: global-environment + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + - name: Run Spotless + run: ./mvnw spotless:check -Pcheck -T1C + + check-license: + if: ${{ needs.global-environment.outputs.GLOBAL_JOB_ENABLED == 'true' }} + name: Check - License + needs: global-environment + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v3 + - name: Run Apache Rat + run: ./mvnw apache-rat:check -Pcheck -T1C \ No newline at end of file diff --git a/.github/workflows/required-reusable.yml b/.github/workflows/required-reusable.yml new file mode 100644 index 0000000000000..bc54fa0f6a5c0 --- /dev/null +++ b/.github/workflows/required-reusable.yml @@ -0,0 +1,68 @@ +# +# 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. +# + +on: + workflow_call: + outputs: + GLOBAL_CACHE_PREFIX: + value: ${{ jobs.init-environment.outputs.GLOBAL_CACHE_PREFIX }} + GLOBAL_RUNS_ON: + value: ${{ jobs.init-environment.outputs.GLOBAL_RUNS_ON }} + GLOBAL_JOB_ENABLED: + value: ${{ jobs.init-environment.outputs.GLOBAL_JOB_ENABLED }} + GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE: + value: ${{ jobs.init-environment.outputs.GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE }} + +jobs: + init-environment: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + sparse-checkout: | + .github/workflows/resources/variables/ + - name: Setup Environment + id: import-variables + run: | + cat .github/workflows/resources/variables/env-variables.properties | while read line + do + echo ${line} >> $GITHUB_OUTPUT + done + echo "GLOBAL_REPOSITORY=${{ env.GLOBAL_REPOSITORY }}" + echo "DISABLE_CI=${{ env.DISABLE_CI }}" + GLOBAL_CACHE_PREFIX=$(echo '${{ env.GLOBAL_REPOSITORY }}' | sed 's/\//_/g') + echo "GLOBAL_CACHE_PREFIX=${GLOBAL_CACHE_PREFIX}" >> $GITHUB_OUTPUT + - name: Check If Job is Executable + id: check-job-executable + env: + JSON_LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }} + shell: sh + run: | + GLOBAL_CACHE_PREFIX=$(echo '${{ steps.import-variables.outputs.GLOBAL_REPOSITORY }}' | sed 's/\//-/g') + echo "GLOBAL_CACHE_PREFIX=${GLOBAL_CACHE_PREFIX}" >> $GITHUB_OUTPUT + if [ ${{ toJSON(github.repository) }} = ${{ steps.import-variables.outputs.GLOBAL_REPOSITORY }} ]; then + echo "GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE=true" >> $GITHUB_OUTPUT + echo "GLOBAL_JOB_ENABLED=false" >> $GITHUB_OUTPUT + if [ -z "${{ steps.import-variables.outputs.DISABLE_CI }}"] || [ "${{ steps.import-variables.outputs.DISABLE_CI }}"=="false" ] ; then + echo "GLOBAL_JOB_ENABLED=true" >> $GITHUB_OUTPUT + fi + fi + outputs: + GLOBAL_RUNS_ON: ${{ steps.import-variables.outputs.GLOBAL_RUNS_ON }} + GLOBAL_JOB_ENABLED: ${{ steps.check-job-executable.outputs.GLOBAL_JOB_ENABLED }} + GLOBAL_CACHE_PREFIX: ${{ steps.check-job-executable.outputs.GLOBAL_CACHE_PREFIX }} + GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE: ${{ steps.check-job-executable.outputs.GLOBAL_IS_NIGHTLY_JOB_EXECUTABLE }} \ No newline at end of file From a2ef30a6bebc1506ffc83973f477f5889773403c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 22:23:24 +0800 Subject: [PATCH 07/10] Trigger GitHub Action --- .github/workflows/required-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/required-check.yml b/.github/workflows/required-check.yml index bc195e09d789f..240c10e663f2e 100644 --- a/.github/workflows/required-check.yml +++ b/.github/workflows/required-check.yml @@ -62,4 +62,4 @@ jobs: steps: - uses: actions/checkout@v3 - name: Run Apache Rat - run: ./mvnw apache-rat:check -Pcheck -T1C \ No newline at end of file + run: ./mvnw apache-rat:check -Pcheck -T1C From 28d9538f426d61913f519944128f7e7a7d1d2e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 22:56:21 +0800 Subject: [PATCH 08/10] Trigger GitHub Action --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f96112fe57e91..944f6750895b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ name: CI on: push: + pull_request: workflow_dispatch: concurrency: From ff16014d70a24f3a9480675273f87c23bad78af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 23:11:37 +0800 Subject: [PATCH 09/10] Trigger GitHub Action --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 944f6750895b5..b985820a70a2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: timeout-minutes: 5 env: ACTIONS_FEISHU_TAG: 'v1.3.1' - INPUT_WEBHOOK: "${{ secrets.FEISHU_ROBOT_NIGHTLY_BUILD }}" + INPUT_WEBHOOK: "${{ secrets.FEISHU_ROBOT_PR_BUILD }}" INPUT_MESSAGE_TYPE: "post" INPUT_TITLE: "Warning" INPUT_CONTENT: "The CI job failed. Please check the log for details." From 1c6cdac82104fcf301f91bdcd807091dbd5467bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=BF=B5=E5=90=9B=20Nianjun=20Sun?= Date: Wed, 25 Oct 2023 23:12:18 +0800 Subject: [PATCH 10/10] Trigger GitHub Action --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b985820a70a2d..944f6750895b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: timeout-minutes: 5 env: ACTIONS_FEISHU_TAG: 'v1.3.1' - INPUT_WEBHOOK: "${{ secrets.FEISHU_ROBOT_PR_BUILD }}" + INPUT_WEBHOOK: "${{ secrets.FEISHU_ROBOT_NIGHTLY_BUILD }}" INPUT_MESSAGE_TYPE: "post" INPUT_TITLE: "Warning" INPUT_CONTENT: "The CI job failed. Please check the log for details."