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/11 00:27:38 UTC

[shardingsphere] branch master updated: Refactor : refactor and upgrade all actions/cache (#21466)

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 b38b382736a Refactor : refactor and upgrade all actions/cache (#21466)
b38b382736a is described below

commit b38b382736a9005bb51ef5c44722e6f3ee5a6ef6
Author: 孙念君 Nianjun Sun <su...@sphere-ex.com>
AuthorDate: Tue Oct 11 08:27:21 2022 +0800

    Refactor : refactor and upgrade all actions/cache (#21466)
---
 .github/workflows/check.yml                        |  7 +-
 .github/workflows/ci.yml                           | 14 ++--
 .github/workflows/docker-release.yml               |  6 +-
 .github/workflows/issue-automation.yml             | 78 ----------------------
 .github/workflows/it-scaling.yml                   | 12 ++--
 .github/workflows/it-transaction.yml               |  7 +-
 .github/workflows/it.yml                           | 35 ++++++----
 .github/workflows/nightly-build.yml                |  7 +-
 .github/workflows/nightly-ci.yml                   |  7 +-
 .github/workflows/nightly-it-example-generator.yml |  7 +-
 10 files changed, 60 insertions(+), 120 deletions(-)

diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 135b670e1d6..2415634d4c0 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -32,6 +32,7 @@ on:
     paths:
       - '**/src/main/**'
       - '**/src/test/**'
+      - 'src/resources/**'
       - '.github/workflows/checkstyle-and-license-check.yml'
       - 'examples/shardingsphere-example-generator/**'
       - '!examples/**'
@@ -48,12 +49,12 @@ jobs:
     timeout-minutes: 10
     steps:
       - uses: actions/checkout@v3
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-
       - name: Run checkstyle
         run: ./mvnw checkstyle:check -T1C
 
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f824c1aa05e..3ce42668b85 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,7 +23,6 @@ on:
     paths:
       - '.github/workflows/ci.yml'
       - '**/pom.xml'
-      - 'src/resources/**'
       - '**/src/main/**'
       - '**/src/test/**'
       - '!distribution/**'
@@ -35,7 +34,6 @@ on:
     paths:
       - '.github/workflows/ci.yml'
       - '**/pom.xml'
-      - 'src/resources/**'
       - '**/src/main/**'
       - '**/src/test/**'
       - '!distribution/**'
@@ -67,12 +65,12 @@ jobs:
         with:
           distribution: 'temurin'
           java-version: ${{ matrix.java-version }}
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-
       - name: Maven resolve ranges
         run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
       - name: Build prod with Maven
@@ -87,12 +85,12 @@ jobs:
     steps:
       - uses: actions/checkout@v3
       - name: Cache Maven Repos
-        uses: actions/cache@v2
+        uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
-            ${{ runner.os }}-maven- 
+            shardingsphere-maven-third-party-
       - uses: actions/setup-java@v3
         with:
           distribution: 'temurin'
diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml
index 6b6dd413357..d8460dff2ac 100644
--- a/.github/workflows/docker-release.yml
+++ b/.github/workflows/docker-release.yml
@@ -38,12 +38,12 @@ jobs:
         with:
           username: ${{ secrets.DOCKERHUB_USERNAME }}
           password: ${{ secrets.DOCKERHUB_TOKEN }}
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: shardingsphere-maven-third-party-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-
       - uses: actions/setup-java@v3
         with:
           distribution: 'temurin'
diff --git a/.github/workflows/issue-automation.yml b/.github/workflows/issue-automation.yml
deleted file mode 100644
index 9d6d5987c2b..00000000000
--- a/.github/workflows/issue-automation.yml
+++ /dev/null
@@ -1,78 +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: Issue Automation
-
-## TODO disable this workflow temporarily, will reopen when discussion about this robot is done.
-on:
-  project:
-    types: [created]
-
-jobs:
-  comment-action:
-    runs-on: ubuntu-latest
-    if: ${{ github.repository == 'apache/shardingsphere' && github.event_name == 'issue_comment' }}
-    steps:
-      - name: Trigger the CI workflow
-        if: ${{ contains( github.event.comment.body , '/run ci') }} 
-        uses: mvasigh/dispatch-action@main
-        with:
-          token: ${{ secrets.PERSONAL_TOKEN }}
-          repo: shardingsphere
-          owner: ${{ github.actor }}
-          event_type: ci-completed
-  remove-inactive:
-    runs-on: ubuntu-latest
-    if: ${{ github.repository == 'apache/shardingsphere' && github.event_name == 'issues' && github.event.action == 'reopened' }}
-    steps:
-    - name: Remove "status:inactive" label
-      if: ${{ contains( github.event.issue.labels.*.name , format('status{0} inactive', ':') ) }}
-      uses: actions-cool/issues-helper@v2.2.1
-      with:
-        actions: 'remove-labels'
-        token: ${{ secrets.GITHUB_TOKEN }}
-        issue-number: ${{ github.event.issue.number }}
-        labels: "status: inactive"
-  check-inactive-issue:
-    runs-on: ubuntu-latest
-    concurrency: check-inactive  # singleton-run-stage
-    if: ${{ github.repository == 'apache/shardingsphere' && github.event_name == 'schedule' }}
-    steps:
-      - name: Check inactive   # add `status: inactive` label
-        uses: actions-cool/issues-helper@v2.2.1 
-        with: 
-          actions: 'check-inactive' 
-          token: ${{ secrets.GITHUB_TOKEN }} 
-          inactive-day: 15
-          inactive-label: "status: inactive"
-          body: |
-            Hello ${{ github.event.issue.user.login }}, this issue has not received a reply for several days.
-            This issue is supposed to be closed.
-          contents: "heart"
-  close-issue:
-    runs-on: ubuntu-latest
-    concurrency:    # singleton-run-stage
-      group: close-issue
-      cancel-in-progress: true
-    if: ${{ github.repository == 'apache/shardingsphere' && github.event_name == 'schedule' || ( github.repository == 'apache/shardingsphere' && github.event_name == 'issues' && github.event.action == 'labeled' ) }}
-    steps:
-      - name: Close Issue   # close issues with `labels`
-        uses: actions-cool/issues-helper@v2.2.1
-        with:
-          actions: 'close-issues'
-          token: ${{ secrets.GITHUB_TOKEN }}
-          labels: 'status: inactive'
diff --git a/.github/workflows/it-scaling.yml b/.github/workflows/it-scaling.yml
index 07a11c44f7e..e17407f1b57 100644
--- a/.github/workflows/it-scaling.yml
+++ b/.github/workflows/it-scaling.yml
@@ -81,12 +81,13 @@ jobs:
     steps:
       - uses: actions/checkout@v3
       - name: Cache Maven Repos
-        uses: actions/cache@v2
+        uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-it-cache-${{ github.sha }}
+          key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-it-cache-
+            shardingsphere-maven-third-party-
       - name: Set up JDK 8
         uses: actions/setup-java@v3
         with:
@@ -116,7 +117,10 @@ jobs:
         uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-it-cache-${{ github.sha }}
+          key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
+          restore-keys: |
+            shardingsphere-maven-third-party-it-cache-
+            shardingsphere-maven-third-party-
       - name: Set up JDK 8
         uses: actions/setup-java@v3
         with:
diff --git a/.github/workflows/it-transaction.yml b/.github/workflows/it-transaction.yml
index 0637b0ff754..a494a08501c 100644
--- a/.github/workflows/it-transaction.yml
+++ b/.github/workflows/it-transaction.yml
@@ -70,12 +70,13 @@ jobs:
     steps:
       - uses: actions/checkout@v3
       - name: Cache Maven Repos
-        uses: actions/cache@v2
+        uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-it-cache-${{ github.sha }}
+          key: shardingsphere-maven-third-party-it-cache${{ github.sha }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-it-cache
+            shardingsphere-maven-third-party-
       - name: Set up JDK 8
         uses: actions/setup-java@v3
         with:
diff --git a/.github/workflows/it.yml b/.github/workflows/it.yml
index cc6050371bd..d6230927dd3 100644
--- a/.github/workflows/it.yml
+++ b/.github/workflows/it.yml
@@ -73,12 +73,13 @@ jobs:
         with:
           distribution: 'temurin'
           java-version: '8'
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-it-cache-${{ github.sha }}
+          key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-it-cache-
+            shardingsphere-maven-third-party-
       - name: Maven resolve ranges
         run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
       - name: Build IT image
@@ -105,10 +106,13 @@ jobs:
         scenario: [ empty_rules, rdl_empty_rules ]
     steps:
       - uses: actions/checkout@v2
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-it-cache-${{ github.sha }}
+          key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
+          restore-keys: |
+            shardingsphere-maven-third-party-it-cache
+            shardingsphere-maven-third-party-
       - uses: actions/setup-java@v3
         with:
           distribution: 'temurin'
@@ -142,10 +146,13 @@ jobs:
             mode: Cluster
     steps:
       - uses: actions/checkout@v2
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-it-cache-${{ github.sha }}
+          key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
+          restore-keys: |
+            shardingsphere-maven-third-party-it-cache-
+            shardingsphere-maven-third-party-
       - uses: actions/setup-java@v3
         with:
           distribution: 'temurin'
@@ -179,10 +186,13 @@ jobs:
             mode: Cluster
     steps:
       - uses: actions/checkout@v2
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-it-cache-${{ github.sha }}
+          key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
+          restore-keys: |
+            shardingsphere-maven-third-party-it-cache-
+            shardingsphere-maven-third-party-
       - uses: actions/setup-java@v3
         with:
           distribution: 'temurin'
@@ -208,12 +218,13 @@ jobs:
         with:
           distribution: 'temurin'
           java-version: '8'
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: shardingsphere-maven-third-party-it-cache-${{ github.sha }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-it-cache-
+            shardingsphere-maven-third-party-
       - name: Maven resolve ranges
         run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
       - name: Build Project
diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml
index 71055531f6e..dd993fd7a60 100644
--- a/.github/workflows/nightly-build.yml
+++ b/.github/workflows/nightly-build.yml
@@ -30,12 +30,13 @@ jobs:
     runs-on: ubuntu-latest
     timeout-minutes: 60
     steps:
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: shardingsphere-maven-third-party-cache-${{ github.sha }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-cache-
+            shardingsphere-maven-third-party-
       - uses: actions/checkout@v2
       - uses: actions/setup-java@v3
         with:
diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml
index 507e8681b42..c36b05b52c4 100644
--- a/.github/workflows/nightly-ci.yml
+++ b/.github/workflows/nightly-ci.yml
@@ -44,12 +44,13 @@ jobs:
         with:
           distribution: 'temurin'
           java-version: ${{ matrix.java-version }}
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: shardingsphere-maven-third-party-cache-${{ github.sha }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-cache-
+            shardingsphere-maven-third-party-
       - name: Build prod with Maven
         run: ./mvnw -T1C -B -ntp clean install
       - name: Build examples with Maven
diff --git a/.github/workflows/nightly-it-example-generator.yml b/.github/workflows/nightly-it-example-generator.yml
index 9b196fd2efc..1c16cb1e925 100644
--- a/.github/workflows/nightly-it-example-generator.yml
+++ b/.github/workflows/nightly-it-example-generator.yml
@@ -56,12 +56,13 @@ jobs:
         with:
           distribution: 'temurin'
           java-version: '8'
-      - uses: actions/cache@v2
+      - uses: actions/cache@v3
         with:
           path: ~/.m2/repository
-          key: shardingsphere-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+          key: shardingsphere-maven-third-party-cache-${{ github.sha }}
           restore-keys: |
-            ${{ runner.os }}-maven-
+            shardingsphere-maven-third-party-cache-
+            shardingsphere-maven-third-party-
       - name: Maven resolve ranges
         run: ./mvnw versions:resolve-ranges -ntp -Dincludes='org.springframework:*,org.springframework.boot:*'
       - name: Build with Maven