This is an automated email from the ASF dual-hosted git repository.
zhaojinchao 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 1d6da4939cd Refactor : combine the nightly build (#27345) (#27347)
1d6da4939cd is described below
commit 1d6da4939cd859b39664a3f36aacf8d4359f6d88
Author: 孙念君 Nianjun Sun <[email protected]>
AuthorDate: Fri Jul 21 11:25:41 2023 +0800
Refactor : combine the nightly build (#27345) (#27347)
* Refactor : combine the nightly build (#27345)
* Remove : remove the duplicated night build example (#27345)
---
.github/workflows/nightly-build-artifact.yml | 130 ---------------------
...nightly-build-example.yml => nightly-build.yml} | 116 ++++++++++++++++--
2 files changed, 109 insertions(+), 137 deletions(-)
diff --git a/.github/workflows/nightly-build-artifact.yml
b/.github/workflows/nightly-build-artifact.yml
deleted file mode 100644
index 4d317ceab64..00000000000
--- a/.github/workflows/nightly-build-artifact.yml
+++ /dev/null
@@ -1,130 +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
-
-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
- HUB: ghcr.io/apache/shardingsphere
- PROXY: ghcr.io/apache/shardingsphere-proxy
- PROXY_NATIVE: ghcr.io/apache/shardingsphere-proxy-native
-
-jobs:
- upload-to-nightlies:
- if: (github.event_name == 'schedule' && github.repository ==
'apache/shardingsphere')
- name: Upload to Nightly Builds
- 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 }}
- restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
- ${{ env.REPOSITORY_NAME }}-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/[email protected]
- 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
- runs-on: ubuntu-latest
- 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: ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-${{
github.sha }}
- restore-keys: |
- ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
- ${{ env.REPOSITORY_NAME }}-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:
- version: '22.3.1'
- java-version: '17'
- components: 'espresso,native-image'
- github-token: ${{ secrets.GITHUB_TOKEN }}
- cache: 'maven'
- - 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
diff --git a/.github/workflows/nightly-build-example.yml
b/.github/workflows/nightly-build.yml
similarity index 58%
rename from .github/workflows/nightly-build-example.yml
rename to .github/workflows/nightly-build.yml
index 7352f86a0b2..45766919dbf 100644
--- a/.github/workflows/nightly-build-example.yml
+++ b/.github/workflows/nightly-build.yml
@@ -15,18 +15,120 @@
# limitations under the License.
#
-name: Nightly - E2E Example Generator
+name: Nightly - Build
on:
schedule:
- - cron: '0 19 */1 * *' # once a day. UTC time
+ - cron: '0 16 */1 * *' # once a day. UTC time
workflow_dispatch:
-
+ inputs:
+ commit-id:
+ required: false
+ type: string
+
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
+ 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
+ HUB: ghcr.io/apache/shardingsphere
+ PROXY: ghcr.io/apache/shardingsphere-proxy
+ PROXY_NATIVE: ghcr.io/apache/shardingsphere-proxy-native
jobs:
+ upload-to-nightlies:
+ if: github.repository == 'apache/shardingsphere'
+ name: Upload to Nightly Builds
+ 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 }}
+ restore-keys: |
+ ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
+ ${{ env.REPOSITORY_NAME }}-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/[email protected]
+ 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
+ runs-on: ubuntu-latest
+ 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: ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-${{
github.sha }}
+ restore-keys: |
+ ${{ env.REPOSITORY_NAME }}-maven-third-party-cache-
+ ${{ env.REPOSITORY_NAME }}-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:
+ version: '22.3.1'
+ java-version: '17'
+ components: 'espresso,native-image'
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ cache: 'maven'
+ - 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: github.repository == 'apache/shardingsphere'
name: Build Project
@@ -46,7 +148,7 @@ jobs:
${{ env.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 }}
@@ -62,7 +164,7 @@ jobs:
mode: [ standalone, cluster-zookeeper ]
transaction: [ local, xa-atomikos, xa-narayana ]
product: [ jdbc ]
- exclude:
+ exclude:
- feature: shadow
framework: spring-boot-starter-jpa
- feature: shadow
@@ -111,7 +213,7 @@ jobs:
- name: Generate Examples
run: ./mvnw -B clean install -f
examples/shardingsphere-example-generator/pom.xml -Pexample-generator
-Dproducts=${{ matrix.product }} -Dmodes=${{ matrix.mode }} -Dtransactions=${{
matrix.transaction }} -Dfeatures=${{ matrix.feature }} -Dframeworks=${{
matrix.framework }}
- name: Test Examples
- run : ./mvnw -B test -f
examples/shardingsphere-example-generator/target/generated-sources/shardingsphere-jdbc-sample/${{
matrix.feature }}--${{ matrix.framework }}--${{ matrix.mode }}--${{
matrix.transaction }}/pom.xml -Pexample-generator
-Dexec.cleanupDaemonThreads=false
+ run : ./mvnw -B test -f
examples/shardingsphere-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-example-generator/target/generated-sources/shardingsphere-jdbc-sample/