This is an automated email from the ASF dual-hosted git repository.
panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 7a0f5b41dc8 Refactor workflow variables (#27464)
7a0f5b41dc8 is described below
commit 7a0f5b41dc87af0daf41c1c80593a12d73a51d86
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Wed Jul 26 14:52:46 2023 +0800
Refactor workflow variables (#27464)
* Remove : remove useless event trigger from ci workflow
* Refactor : extract env.REPOSITORY_NAME into config file (#27463)
* Refactor : extract env.REPOSITORY_NAME into config file (#27463)
* Refactor : refactor the output constant (#27463)
* Refactor : refactor the output constant (#27463)
* Refactor : refactor the output constant (#27463)
* Refactor : refactor all output constant (#27463)
* Refactor : add name for reusable job (#27463)
* Refactor : add back the repository_dispatch (#27463)
* Refactor : refactor repository_dispatch type (#27463)
* Fix : fix the missing needs in E2E-SQL (#27463)
---
.github/workflows/ci.yml | 19 +++++----
.github/workflows/e2e-agent.yml | 14 ++++---
.github/workflows/e2e-operation.yml | 21 ++++++----
.github/workflows/e2e-sql.yml | 25 ++++++-----
.github/workflows/nightly-build.yml | 36 +++++++++-------
.github/workflows/nightly-check.yml | 31 ++++++++------
.github/workflows/nightly-ci.yml | 19 +++++----
.github/workflows/nightly-e2e-operation.yml | 16 ++++---
.github/workflows/nightly-sql-parser.yml | 15 ++++---
.github/workflows/required-check.yml | 5 +--
.../{required-check.yml => required-reusable.yml} | 49 +++++++---------------
.../resources/variables/env-variables.properties | 1 +
.github/workflows/schedule-report.yml | 14 ++++---
13 files changed, 143 insertions(+), 122 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 16896b3ce11..ec54a825e89 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -43,20 +43,24 @@ on:
- 'test/e2e/driver/**'
- '!*.md'
repository_dispatch:
- types: [ci-completed]
+ types: ci-completed
workflow_dispatch:
concurrency:
- group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
+ group: ci-${{ 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
- REPOSITORY_NAME: shardingsphere
jobs:
+ global-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
ci:
name: CI - Compile by JDK 11 and Run on JDK 8
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
@@ -69,16 +73,15 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Build Project with Maven
- run: ./mvnw -T1C -B -ntp clean install -DskipTests
+ 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 -T1C -B -ntp -fae test
-
+ run: ./mvnw test -T1C -B -ntp -fae
diff --git a/.github/workflows/e2e-agent.yml b/.github/workflows/e2e-agent.yml
index 269e14a90aa..04e423358f1 100644
--- a/.github/workflows/e2e-agent.yml
+++ b/.github/workflows/e2e-agent.yml
@@ -53,12 +53,16 @@ concurrency:
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 -Dmaven.javadoc.skip=true
-Dcheckstyle.skip=true -Djacoco.skip=true -Dspotless.apply.skip=true
- REPOSITORY_NAME: shardingsphere
+ 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:
- mysql:
+ global-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
+ agent-mysql:
name: E2E - Agent with MySQL
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
@@ -100,9 +104,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Build Project
run:
./mvnw -B clean install -DskipITs -DskipTests -Prelease
diff --git a/.github/workflows/e2e-operation.yml
b/.github/workflows/e2e-operation.yml
index 34ea357d62d..343d9267685 100644
--- a/.github/workflows/e2e-operation.yml
+++ b/.github/workflows/e2e-operation.yml
@@ -24,14 +24,17 @@ on:
workflow_dispatch:
concurrency:
- group: e2e-pipeline-${{ github.workflow }}-${{ github.ref }}
+ 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 -Dmaven.javadoc.skip=true
-Dcheckstyle.skip=true -Dspotless.apply.skip=true -Djacoco.skip=true
-Dfailsafe.skipAfterFailureCount=1 -Dio.netty.leakDetectionLevel=advanced
- REPOSITORY_NAME: shardingsphere
+ 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-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
detect-changed-files:
name: Detect Changed Files
runs-on: ubuntu-latest
@@ -46,10 +49,11 @@ jobs:
outputs:
changed_operations: ${{ steps.filter.outputs.changes }}
- e2e-operation-job:
- needs: detect-changed-files
+ e2e-operation:
+ needs: [ detect-changed-files, global-env ]
name: E2E - ${{ matrix.operation }} on ${{ matrix.image.version }}
runs-on: ubuntu-latest
+ timeout-minutes: 40
strategy:
max-parallel: 20
fail-fast: false
@@ -61,7 +65,6 @@ jobs:
image: { type: "it.docker.postgresql.version", version:
"postgres:12-alpine" }
- operation: showprocesslist
image: { type: "it.docker.opengauss.version", version:
"enmotech/opengauss:2.1.0" }
- timeout-minutes: 40
steps:
- env:
changed_operations: ${{
needs.detect-changed-files.outputs.changed_operations }}
@@ -87,10 +90,10 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-e2e-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-e2e-cache-${{ github.sha }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-e2e-cache-
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-e2e-cache-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Setup JDK 11
if: (env.skip_current_step == 'false')
uses: actions/setup-java@v3
diff --git a/.github/workflows/e2e-sql.yml b/.github/workflows/e2e-sql.yml
index 6e55a9624d1..4ebd7217a4d 100644
--- a/.github/workflows/e2e-sql.yml
+++ b/.github/workflows/e2e-sql.yml
@@ -59,13 +59,17 @@ concurrency:
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 -Dmaven.javadoc.skip=true
-Dcheckstyle.skip=true -Djacoco.skip=true -Dspotless.apply.skip=true
- REPOSITORY_NAME: shardingsphere
+ 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-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
build-e2e-image:
name: Build E2E Image
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
@@ -77,25 +81,25 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-e2e-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-e2e-cache-${{ github.sha }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-e2e-cache-
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-e2e-cache-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-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/${{ env.REPOSITORY_NAME }}-proxy-test.tar
apache/shardingsphere-proxy-test:latest
+ run: docker save -o /tmp/${{
needs.global-env.outputs.GLOBAL_REPOSITORY_NAME }}-proxy-test.tar
apache/shardingsphere-proxy-test:latest
- uses: actions/upload-artifact@v3
with:
name: e2e-image
- path: /tmp/${{ env.REPOSITORY_NAME }}-proxy-test.tar
+ path: /tmp/${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-proxy-test.tar
retention-days: 1
e2e-sql:
name: E2E - ${{ matrix.adapter }} - ${{ matrix.scenario }} - ${{
matrix.mode }} on ${{ matrix.database }}
runs-on: ubuntu-latest
timeout-minutes: 15
- needs: build-e2e-image
+ needs: [ build-e2e-image, global-env ]
strategy:
max-parallel: 20
fail-fast: false
@@ -126,13 +130,12 @@ jobs:
- adapter: proxy
mode: Standalone
scenario: passthrough
-
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-e2e-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-e2e-cache-${{ github.sha }}
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
@@ -145,6 +148,6 @@ jobs:
path: /tmp/
- name: Load E2E Image
if: matrix.adapter == 'proxy'
- run: docker load -i /tmp/${{ env.REPOSITORY_NAME }}-proxy-test.tar
+ run: docker load -i /tmp/${{
needs.global-env.outputs.GLOBAL_REPOSITORY_NAME }}-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
index 45766919dbf..52e2084be5d 100644
--- a/.github/workflows/nightly-build.yml
+++ b/.github/workflows/nightly-build.yml
@@ -25,29 +25,33 @@ on:
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 -Dcheckstyle.skip=true
-Dmaven.javadoc.skip=true -Djacoco.skip=true -DskipITs -DskipTests
-Dspotless.apply.skip=true
- REPOSITORY: apache/shardingsphere
- REPOSITORY_NAME: shardingsphere
+ 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-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
upload-to-nightlies:
if: github.repository == 'apache/shardingsphere'
name: Upload to Nightly Builds
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-${{ github.sha }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
@@ -69,6 +73,7 @@ jobs:
build-proxy-image:
if: github.repository == 'apache/shardingsphere'
name: Build Proxy Image
+ needs: global-env
runs-on: ubuntu-latest
permissions:
contents: read
@@ -85,10 +90,10 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-${{ github.sha }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Login Container Registry
uses: docker/login-action@v2
with:
@@ -132,6 +137,7 @@ jobs:
build-cache:
if: github.repository == 'apache/shardingsphere'
name: Build Project
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
@@ -143,18 +149,18 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Build with Maven
run: ./mvnw -B -T1C -ntp clean install -DskipITs -DskipTests
-
+
generate-and-test-examples:
if: github.repository == 'apache/shardingsphere'
name: Example-${{ matrix.feature }}-${{ matrix.framework }}-${{
matrix.mode }}-${{ matrix.transaction }}
+ needs: build-cache
runs-on: ubuntu-latest
timeout-minutes: 90
- needs: build-cache
strategy:
max-parallel: 20
fail-fast: false
@@ -203,9 +209,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Prepare Environments
run: sh
.github/workflows/resources/scripts/nightly-build-example/init-mysql-container.sh
- name: Build with Maven
diff --git a/.github/workflows/nightly-check.yml
b/.github/workflows/nightly-check.yml
index 8ec45077bde..bc593e09d87 100644
--- a/.github/workflows/nightly-check.yml
+++ b/.github/workflows/nightly-check.yml
@@ -23,13 +23,17 @@ on:
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 -Dcheckstyle.skip=true
- CACHE_PREFIX: shardingsphere
+ 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-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
check-spotbugs:
if: (github.repository == 'apache/shardingsphere')
name: Check - SpotBugs
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
@@ -37,15 +41,16 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.CACHE_PREFIX }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.CACHE_PREFIX }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Run SpotBugs
run: ./mvnw clean install spotbugs:check -T1C
check-and-report-sonarcloud:
if: (github.repository == 'apache/shardingsphere')
name: Check - SonarCloud
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
@@ -62,19 +67,20 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.CACHE_PREFIX }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.CACHE_PREFIX }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-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 -Dmaven.javadoc.skip=true
-Drat.skip=true -Djacoco.skip=true -DskipTests
+ 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-env
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
@@ -91,9 +97,9 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.CACHE_PREFIX }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.CACHE_PREFIX }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Aggregate checkstyle report
run:
./mvnw clean verify checkstyle:checkstyle-aggregate
@@ -135,6 +141,7 @@ jobs:
check-codeql:
if: (github.repository == 'apache/shardingsphere')
name: Check - CodeQL
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 45
permissions:
@@ -154,11 +161,11 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.CACHE_PREFIX }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.CACHE_PREFIX }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Install Project
- run: ./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true
-Drat.skip=true
+ run: ./mvnw clean install -DskipTests
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml
index eb8994df3b7..70b65aadcd7 100644
--- a/.github/workflows/nightly-ci.yml
+++ b/.github/workflows/nightly-ci.yml
@@ -24,12 +24,16 @@ on:
env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
-Dmaven.wagon.http.retryHandler.class=standard
-Dmaven.wagon.http.retryHandler.count=3
- REPOSITORY_NAME: shardingsphere
jobs:
+ global-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
ci:
if: github.repository == 'apache/shardingsphere'
name: CI - JDK ${{ matrix.java-version }} on ${{ matrix.os }}
+ needs: global-env
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
@@ -50,10 +54,10 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-${{ github.sha }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Build Project with Maven
run: ./mvnw clean install -B -ntp -T1C
- name: Build Examples with Maven
@@ -62,6 +66,7 @@ jobs:
ci-jdk8:
if: github.repository == 'apache/shardingsphere'
name: CI - JDK 8 on ${{ matrix.os }}
+ needs: global-env
runs-on: ${{ matrix.os }}
timeout-minutes: 90
strategy:
@@ -81,10 +86,10 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-${{ github.sha }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Build prod with Maven
run: ./mvnw clean install -DskipTests -B -ntp -T1C
- name: Setup JDK 8 for Test
diff --git a/.github/workflows/nightly-e2e-operation.yml
b/.github/workflows/nightly-e2e-operation.yml
index f7f534093c2..0d780b5d1c8 100644
--- a/.github/workflows/nightly-e2e-operation.yml
+++ b/.github/workflows/nightly-e2e-operation.yml
@@ -27,15 +27,19 @@ concurrency:
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 -Dmaven.javadoc.skip=true
-Dcheckstyle.skip=true -Dspotless.apply.skip=true -Djacoco.skip=true
-Dfailsafe.skipAfterFailureCount=1 -Dio.netty.leakDetectionLevel=advanced
- REPOSITORY_NAME: shardingsphere
+ 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-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
e2e-operation-job:
name: E2E - ${{ matrix.operation }} on ${{ matrix.image.version }}
+ needs: global-env
runs-on: ubuntu-latest
strategy:
- max-parallel: 5
+ max-parallel: 20
fail-fast: false
matrix:
operation: [ transaction, pipeline, showprocesslist ]
@@ -53,10 +57,10 @@ jobs:
uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-e2e-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-e2e-cache-${{ github.sha }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-e2e-cache-
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-e2e-cache-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Setup JDK 11
uses: actions/setup-java@v3
with:
diff --git a/.github/workflows/nightly-sql-parser.yml
b/.github/workflows/nightly-sql-parser.yml
index 300371991d8..4b27beb34ea 100644
--- a/.github/workflows/nightly-sql-parser.yml
+++ b/.github/workflows/nightly-sql-parser.yml
@@ -23,15 +23,18 @@ on:
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 -Dcheckstyle.skip=true
-Dspotless.apply.skip=true -Dmaven.javadoc.skip=true -Djacoco.skip=true
+ 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
- REPOSITORY: apache/shardingsphere
- REPOSITORY_NAME: shardingsphere
jobs:
+ global-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
database-parse:
if: github.repository == 'apache/shardingsphere'
name: CI - JDK ${{ matrix.java-version }} for ${{ matrix.database }}
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 90
strategy:
@@ -49,10 +52,10 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-${{
github.sha }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-${{ github.sha }}
restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
- ${{ env.REPOSITORY_NAME }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-cache-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-
- name: Build Project with Maven
run: ./mvnw -T1C -B -ntp clean install
- name: Run SQL Parser
diff --git a/.github/workflows/required-check.yml
b/.github/workflows/required-check.yml
index 10af461deee..608f5d00284 100644
--- a/.github/workflows/required-check.yml
+++ b/.github/workflows/required-check.yml
@@ -23,12 +23,9 @@ on:
workflow_dispatch:
concurrency:
- group: check-${{ github.event_name }}-${{ github.workflow }}-${{ github.ref
}}
+ group: check-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
-env:
- REPOSITORY_NAME: shardingsphere
-
jobs:
check-checkstyle:
name: Check - CheckStyle
diff --git a/.github/workflows/required-check.yml
b/.github/workflows/required-reusable.yml
similarity index 50%
copy from .github/workflows/required-check.yml
copy to .github/workflows/required-reusable.yml
index 10af461deee..094428641ed 100644
--- a/.github/workflows/required-check.yml
+++ b/.github/workflows/required-reusable.yml
@@ -15,44 +15,25 @@
# limitations under the License.
#
-name: Required - Check
+name: Required - Reusable
on:
- pull_request:
- branches: [ master ]
- workflow_dispatch:
-
-concurrency:
- group: check-${{ github.event_name }}-${{ github.workflow }}-${{ github.ref
}}
- cancel-in-progress: true
-
-env:
- REPOSITORY_NAME: shardingsphere
+ workflow_call:
+ outputs:
+ GLOBAL_REPOSITORY_NAME:
+ value: ${{ jobs.init-environment.outputs.GLOBAL_REPOSITORY_NAME }}
jobs:
- check-checkstyle:
- name: Check - CheckStyle
- runs-on: ubuntu-latest
- timeout-minutes: 10
- steps:
- - uses: actions/checkout@v3
- - name: Run CheckStyle
- run: ./mvnw checkstyle:check -Dcheckstyle.skip=false -T1C
-
- check-spotless:
- name: Check - Spotless
- runs-on: ubuntu-latest
- timeout-minutes: 10
- steps:
- - uses: actions/checkout@v3
- - name: Run Spotless
- run: ./mvnw spotless:check -T1C
-
- check-license:
- name: Check - License
+ init-environment:
runs-on: ubuntu-latest
- timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- - name: Run Apache Rat
- run: ./mvnw apache-rat:check -Drat.skip=false -T1C
+ - name: Setup Environment
+ id: import-variables
+ run: |
+ cat .github/workflows/resources/variables/env-variables.properties |
while read line
+ do
+ echo ${line} >> $GITHUB_OUTPUT
+ done
+ outputs:
+ GLOBAL_REPOSITORY_NAME: ${{
steps.import-variables.outputs.GLOBAL_REPOSITORY_NAME }}
diff --git a/.github/workflows/resources/variables/env-variables.properties
b/.github/workflows/resources/variables/env-variables.properties
new file mode 100644
index 00000000000..74237410375
--- /dev/null
+++ b/.github/workflows/resources/variables/env-variables.properties
@@ -0,0 +1 @@
+GLOBAL_REPOSITORY_NAME=shardingsphere
diff --git a/.github/workflows/schedule-report.yml
b/.github/workflows/schedule-report.yml
index 1e15ff1a19e..84d2c0b7abd 100644
--- a/.github/workflows/schedule-report.yml
+++ b/.github/workflows/schedule-report.yml
@@ -23,13 +23,17 @@ on:
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 -Dcheckstyle.skip=true
- CACHE_PREFIX: shardingsphere
+ MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false
-Dmaven.wagon.http.retryHandler.class=standard
-Dmaven.wagon.http.retryHandler.count=3
jobs:
+ global-env:
+ name: Import Global Env
+ uses: ./.github/workflows/required-reusable.yml
+
check-and-report-sonarcloud:
if: (github.repository == 'apache/shardingsphere')
name: Check - SonarCloud
+ needs: global-env
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
@@ -46,12 +50,12 @@ jobs:
- uses: actions/cache@v3
with:
path: ~/.m2/repository
- key: ${{ env.CACHE_PREFIX }}-maven-third-party-${{
hashFiles('**/pom.xml') }}
+ key: ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-maven-third-party-${{ hashFiles('**/pom.xml') }}
restore-keys: |
- ${{ env.CACHE_PREFIX }}-maven-third-party-
+ ${{ needs.global-env.outputs.GLOBAL_REPOSITORY_NAME
}}-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 -Dmaven.javadoc.skip=true
-Drat.skip=true -Djacoco.skip=true -DskipTests
+ run: ./mvnw -B clean verify
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-Dsonar.projectKey=apache_shardingsphere -DskipTests