You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by sh...@apache.org on 2022/08/29 16:18:53 UTC

[bookkeeper] branch master updated: [ci] Cache maven dependencies (#3461)

This is an automated email from the ASF dual-hosted git repository.

shoothzj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/bookkeeper.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dc5692b4c [ci] Cache maven dependencies (#3461)
7dc5692b4c is described below

commit 7dc5692b4c137c831c10381ecd4cdd0c331a0e7b
Author: Nicolò Boschi <bo...@gmail.com>
AuthorDate: Mon Aug 29 18:18:48 2022 +0200

    [ci] Cache maven dependencies (#3461)
    
    ### Motivation
    Our current CI doesn't implement a cache solution and it's a waste of resources and time.
    GH offers a builtin action
    https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows
    
    ### Changes
    
    * Added a cache for each job that build with maven
---
 .github/workflows/backward-compat-tests.yml      | 10 ++++++++++
 .github/workflows/bookie-tests.yml               | 10 ++++++++++
 .github/workflows/client-tests.yml               | 10 ++++++++++
 .github/workflows/compatibility-check-java11.yml | 10 ++++++++++
 .github/workflows/compatibility-check-java17.yml | 10 ++++++++++
 .github/workflows/compatibility-check-java8.yml  | 10 ++++++++++
 .github/workflows/integration-tests.yml          | 10 ++++++++++
 .github/workflows/macos-build.yml                | 10 ++++++++++
 .github/workflows/owasp-dep-check.yml            | 11 +++++++++++
 .github/workflows/pr-validation.yml              | 10 ++++++++++
 .github/workflows/remaining-tests.yml            | 12 ++++++++++++
 .github/workflows/replication-tests.yml          | 11 +++++++++++
 .github/workflows/stream-tests.yml               | 11 +++++++++++
 .github/workflows/tls-tests.yml                  | 11 +++++++++++
 .github/workflows/windows-build.yml              | 11 +++++++++++
 15 files changed, 157 insertions(+)

diff --git a/.github/workflows/backward-compat-tests.yml b/.github/workflows/backward-compat-tests.yml
index f63923477c..cd2fab8862 100644
--- a/.github/workflows/backward-compat-tests.yml
+++ b/.github/workflows/backward-compat-tests.yml
@@ -44,6 +44,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 1.8
         uses: actions/setup-java@v1
         with:
diff --git a/.github/workflows/bookie-tests.yml b/.github/workflows/bookie-tests.yml
index 460fe6377c..18a45dba14 100644
--- a/.github/workflows/bookie-tests.yml
+++ b/.github/workflows/bookie-tests.yml
@@ -44,6 +44,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/client-tests.yml b/.github/workflows/client-tests.yml
index e63ad25294..b5103fc04b 100644
--- a/.github/workflows/client-tests.yml
+++ b/.github/workflows/client-tests.yml
@@ -44,6 +44,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/compatibility-check-java11.yml b/.github/workflows/compatibility-check-java11.yml
index ac0b2b3c53..50860b42bd 100644
--- a/.github/workflows/compatibility-check-java11.yml
+++ b/.github/workflows/compatibility-check-java11.yml
@@ -44,6 +44,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/compatibility-check-java17.yml b/.github/workflows/compatibility-check-java17.yml
index 1f29476658..55a0209843 100644
--- a/.github/workflows/compatibility-check-java17.yml
+++ b/.github/workflows/compatibility-check-java17.yml
@@ -43,6 +43,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/compatibility-check-java8.yml b/.github/workflows/compatibility-check-java8.yml
index 0785c6293d..c7ed72afe6 100644
--- a/.github/workflows/compatibility-check-java8.yml
+++ b/.github/workflows/compatibility-check-java8.yml
@@ -44,6 +44,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 1.8
         uses: actions/setup-java@v1
         with:
diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml
index 82068e55a7..baae816354 100644
--- a/.github/workflows/integration-tests.yml
+++ b/.github/workflows/integration-tests.yml
@@ -44,6 +44,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/macos-build.yml b/.github/workflows/macos-build.yml
index 25f64861ea..726e817ead 100644
--- a/.github/workflows/macos-build.yml
+++ b/.github/workflows/macos-build.yml
@@ -40,6 +40,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 11
         uses: actions/setup-java@v3
         with:
diff --git a/.github/workflows/owasp-dep-check.yml b/.github/workflows/owasp-dep-check.yml
index 3f169af95b..4fef7936a9 100644
--- a/.github/workflows/owasp-dep-check.yml
+++ b/.github/workflows/owasp-dep-check.yml
@@ -53,6 +53,17 @@ jobs:
               - 'pom.xml'
               - '**/pom.xml'
 
+      - name: Cache local Maven repository
+        if: ${{ steps.changes.outputs.poms == 'true' }}
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 1.8
         uses: actions/setup-java@v1
         if: ${{ steps.changes.outputs.poms == 'true' }}
diff --git a/.github/workflows/pr-validation.yml b/.github/workflows/pr-validation.yml
index 87c983e457..ee80389228 100644
--- a/.github/workflows/pr-validation.yml
+++ b/.github/workflows/pr-validation.yml
@@ -44,6 +44,16 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/remaining-tests.yml b/.github/workflows/remaining-tests.yml
index 2cebc57922..f778dda463 100644
--- a/.github/workflows/remaining-tests.yml
+++ b/.github/workflows/remaining-tests.yml
@@ -44,6 +44,18 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
+
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/replication-tests.yml b/.github/workflows/replication-tests.yml
index 388fe30016..086769b06e 100644
--- a/.github/workflows/replication-tests.yml
+++ b/.github/workflows/replication-tests.yml
@@ -44,6 +44,17 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/stream-tests.yml b/.github/workflows/stream-tests.yml
index 36c55cac0d..3d9c22f2e3 100644
--- a/.github/workflows/stream-tests.yml
+++ b/.github/workflows/stream-tests.yml
@@ -43,6 +43,17 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/tls-tests.yml b/.github/workflows/tls-tests.yml
index 4107d4401a..79aacfc9c5 100644
--- a/.github/workflows/tls-tests.yml
+++ b/.github/workflows/tls-tests.yml
@@ -44,6 +44,17 @@ jobs:
       - name: Tune Runner VM
         uses: ./.github/actions/tune-runner-vm
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
+
       - name: Set up JDK 11
         uses: actions/setup-java@v2
         with:
diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml
index fe3f06df5b..e75c656f24 100644
--- a/.github/workflows/windows-build.yml
+++ b/.github/workflows/windows-build.yml
@@ -43,6 +43,17 @@ jobs:
       - name: Install mingw
         run: choco install mingw
 
+      - name: Cache local Maven repository
+        id: cache
+        uses: actions/cache@v2
+        with:
+          path: |
+            ~/.m2/repository/*/*/*
+            !~/.m2/repository/org/apache/bookkeeper
+            !~/.m2/repository/org/apache/distributedlog
+          key: ${{ runner.os }}-bookkeeper-all-${{ hashFiles('**/pom.xml') }}
+
+
       - name: Set up JDK 11
         uses: actions/setup-java@v3
         with: