You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by pa...@apache.org on 2022/10/08 07:00:54 UTC
[shardingsphere] branch master updated: Refactor workflow (#21381)
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 250f163a5a4 Refactor workflow (#21381)
250f163a5a4 is described below
commit 250f163a5a4fd47e5b936665e3d3b727d2fd0c6f
Author: Liang Zhang <zh...@apache.org>
AuthorDate: Sat Oct 8 15:00:46 2022 +0800
Refactor workflow (#21381)
---
...{checkstyle-and-license-check.yml => check.yml} | 22 +++----
.github/workflows/ci.yml | 25 ++++----
.github/workflows/daily-ci.yml | 3 -
.github/workflows/daily-example-generator-it.yml | 3 -
.github/workflows/docker-per-commit.yaml | 69 ----------------------
.../workflows/{docker.yml => docker-release.yml} | 34 ++++-------
.../workflows/{issue.yml => issue-automation.yml} | 2 +-
7 files changed, 30 insertions(+), 128 deletions(-)
diff --git a/.github/workflows/checkstyle-and-license-check.yml b/.github/workflows/check.yml
similarity index 76%
rename from .github/workflows/checkstyle-and-license-check.yml
rename to .github/workflows/check.yml
index 1ac3070f4f6..135b670e1d6 100644
--- a/.github/workflows/checkstyle-and-license-check.yml
+++ b/.github/workflows/check.yml
@@ -15,10 +15,7 @@
# limitations under the License.
#
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Check - Checkstyle and License Check
+name: Check
on:
push:
@@ -41,30 +38,29 @@ on:
- '!*.md'
concurrency:
- group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
+ group: check-${{ github.event_name }}-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
- checkstyle-check:
+ check-checkstyle:
+ name: Check - checkstyle
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- - name: Cache Maven Repos
- uses: actions/cache@v2
+ - uses: actions/cache@v2
with:
path: ~/.m2/repository
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- - name: Run Checkstyle
+ - name: Run checkstyle
run: ./mvnw checkstyle:check -T1C
check-license:
- name: license-check
+ name: Check - license
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - name: Check License Header
- uses: apache/skywalking-eyes@v0.4.0
+ - uses: actions/checkout@v3
+ - uses: apache/skywalking-eyes@v0.4.0
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 14803b35586..e46affaa78d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,10 +15,7 @@
# limitations under the License.
#
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
-name: Continuous Integration
+name: CI
on:
push:
@@ -46,18 +43,18 @@ on:
- 'test/integration-driver-test/**'
- '!*.md'
repository_dispatch:
- types: [rerun-ci]
+ types: [ci-completed]
concurrency:
group: ${{ github.event_name }}-${{ 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 -Dcheckstyle.skip=true -Drat.skip=true -Dspotless.apply.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 -Dspotless.apply.skip=true
jobs:
- linux:
- name: JDK ${{ matrix.java_version }} - on ${{ matrix.os }}
+ ci:
+ name: CI - JDK ${{ matrix.java_version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
@@ -66,29 +63,27 @@ jobs:
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- - name: Set up JDK ${{ matrix.java_version }}
- uses: actions/setup-java@v2
+ - uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: ${{ matrix.java_version }}
- name: Maven resolve ranges
run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
- - name: Cache Maven Repos
- uses: actions/cache@v2
+ - uses: actions/cache@v2
with:
path: ~/.m2/repository
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- - name: Build with Maven
+ - name: Build prod with Maven
run: ./mvnw -B -ntp clean install -Dmaven.javadoc.skip=true -Djacoco.skip=true
- name: Build examples with Maven
run: ./mvnw -B -f examples/pom.xml clean package -DskipTests
- test-coverage-report:
+ test-coverage:
if: github.repository == 'apache/shardingsphere'
+ name: Test coverage report
runs-on: ubuntu-latest
- name: ShardingSphere test coverage report
steps:
- uses: actions/checkout@v3
- name: Cache Maven Repos
diff --git a/.github/workflows/daily-ci.yml b/.github/workflows/daily-ci.yml
index 3ceb5056913..10d9e5ff63e 100644
--- a/.github/workflows/daily-ci.yml
+++ b/.github/workflows/daily-ci.yml
@@ -15,9 +15,6 @@
# limitations under the License.
#
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
name: Daily - Continuous Integration
on:
diff --git a/.github/workflows/daily-example-generator-it.yml b/.github/workflows/daily-example-generator-it.yml
index 631255fec56..35f65cf87ac 100644
--- a/.github/workflows/daily-example-generator-it.yml
+++ b/.github/workflows/daily-example-generator-it.yml
@@ -15,9 +15,6 @@
# limitations under the License.
#
-# This workflow will build a Java project with Maven
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-
name: Daily - Example Generator IT
on:
diff --git a/.github/workflows/docker-per-commit.yaml b/.github/workflows/docker-per-commit.yaml
deleted file mode 100644
index 71a72008a66..00000000000
--- a/.github/workflows/docker-per-commit.yaml
+++ /dev/null
@@ -1,69 +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: Docker - Publish Image per Commit
-
-on:
- push:
- branches:
- - master
- paths:
- - '**/pom.xml'
- - '**/src/main/**'
- - '!examples/**'
- - '!distribution/**'
- - 'distribution/proxy/**'
- - '!test/**'
- - '!*.md'
-
-env:
- HUB: ghcr.io/apache/shardingsphere
- PROXY: ghcr.io/apache/shardingsphere-proxy
-
-jobs:
- build:
- if: github.repository == 'apache/shardingsphere'
- runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
- timeout-minutes: 90
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 8
- uses: actions/setup-java@v2
- with:
- distribution: 'temurin'
- java-version: 8
- - name: Cache Maven Repos
- uses: actions/cache@v2
- with:
- path: ~/.m2/repository
- key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
- restore-keys: |
- ${{ runner.os }}-maven-
- - name: Log in to the Container registry
- uses: docker/login-action@v1.10.0
- with:
- registry: ${{ env.HUB }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
- - name: Push docker image
- run: ./mvnw -am -pl distribution/proxy -B -Prelease,docker.buildx.push -DskipTests -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dspotless.apply.skip=true -Drat.skip=true -Dproxy.image.repository=${{ env.PROXY }} -Dproxy.image.tag=${{ github.sha }} clean install
diff --git a/.github/workflows/docker.yml b/.github/workflows/docker-release.yml
similarity index 77%
rename from .github/workflows/docker.yml
rename to .github/workflows/docker-release.yml
index 29354ec93b0..a781ee51103 100644
--- a/.github/workflows/docker.yml
+++ b/.github/workflows/docker-release.yml
@@ -15,7 +15,7 @@
# limitations under the License.
#
-name: Docker - Deploy Docker Image
+name: Docker Release
on:
release:
@@ -31,43 +31,29 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- - uses: actions/checkout@v2
-
- # setup docker
- - name: Set up QEMU
- uses: docker/setup-qemu-action@v1
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v1
-
- - name: Login to DockerHub
- uses: docker/login-action@v1
+ - uses: actions/checkout@v3
+ - uses: docker/setup-qemu-action@v1
+ - uses: docker/setup-buildx-action@v1
+ - uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- - name: Cache Maven Repos
- uses: actions/cache@v2
+ - uses: actions/cache@v2
with:
path: ~/.m2/repository
key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
-
- - name: Set up JDK 8
- uses: actions/setup-java@v1
+ - uses: actions/setup-java@v1
with:
java-version: 8
-
- - name: set environment
+ - name: Set environment
run: export MAVEN_OPTS=' -Dmaven.javadoc.skip=true -Drat.skip=true -Djacoco.skip=true $MAVEN_OPTS'
- - name: Build Project
+ - name: Build docker image
run: |
./mvnw -B -Prelease,docker -DskipTests clean install
docker image ls --format "{{.ID}} {{.Repository}} {{.Tag}}" | grep apache| sed 's/apache\//${{ secrets.DOCKERHUB_USERNAME }}\//' |tr A-Z a-z |awk '{system("docker tag "$1" "$2":latest;docker tag "$1" "$2":"$3";")}'
-
- - name: Push Docker Image
+ - name: Push docker image
run: |
- echo Docker Images:
echo `docker image ls|grep -i ${{ secrets.DOCKERHUB_USERNAME }}|awk '{print $1":"$2}'`
docker image ls|grep -i ${{ secrets.DOCKERHUB_USERNAME }}|awk '{print $1":"$2}'|xargs -i docker push {}
diff --git a/.github/workflows/issue.yml b/.github/workflows/issue-automation.yml
similarity index 98%
rename from .github/workflows/issue.yml
rename to .github/workflows/issue-automation.yml
index 93fb68b388f..e3e9de08d1e 100644
--- a/.github/workflows/issue.yml
+++ b/.github/workflows/issue-automation.yml
@@ -37,7 +37,7 @@ jobs:
token: ${{ secrets.PERSONAL_TOKEN }}
repo: shardingsphere
owner: ${{ github.actor }}
- event_type: rerun-ci
+ event_type: ci-completed
remove-inactive:
runs-on: ubuntu-latest
if: ${{ github.repository == 'apache/shardingsphere' && github.event_name == 'issues' && github.event.action == 'reopened' }}