Skip to content

Commit 5798067

Browse files
committed
GHA: Cache Maven repository for tests and snapshots
Change-Id: I5a440d89a2e1e3361976f2cdbd69bf971154e382 Reviewed-on: https://review.couchbase.org/c/couchbase-jvm-clients/+/228868 Tested-by: David Nault <[email protected]> Reviewed-by: David Nault <[email protected]>
1 parent 39e577b commit 5798067

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

.github/workflows/deploy-snapshot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@ jobs:
3636
server-username: MAVEN_USERNAME
3737
server-password: MAVEN_PASSWORD
3838

39+
cache: 'maven'
40+
3941
- name: Build and deploy to Maven Central
4042
run: .github/scripts/deploy.sh snapshot
4143
env:
4244
MAVEN_USERNAME: ${{ vars.MAVEN_USERNAME }}
4345
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
4446
MAVEN_GPG_KEY: ${{ secrets.SDK_ROBOT_GPG_PRIVATE_KEY }}
4547
MAVEN_GPG_PASSPHRASE: ''
48+
49+
- name: Remove artifacts from Maven repo so they're not cached
50+
run: rm -rfv ~/.m2/repository/com/couchbase/client/

.github/workflows/integration-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
java-version: |
5252
${{ matrix.java-version }}
5353
17
54+
cache: 'maven'
5455

5556
- name: Compile tests
5657
run: |
@@ -103,6 +104,9 @@ jobs:
103104
TEST_JAVA_HOME=$JAVA_HOME_${{ matrix.java-version }}_X64
104105
./mvnw --batch-mode -Dmaven.test.failure.ignore=true -Dmaven.javadoc.skip=true verify -Djvm=${TEST_JAVA_HOME}/bin/java
105106
107+
- name: Remove artifacts from Maven repo so they're not cached
108+
run: rm -rfv ~/.m2/repository/com/couchbase/client/
109+
106110
- name: Publish test results
107111
run: |
108112
curl https://raw.githubusercontent.com/couchbaselabs/junit-markdown/refs/heads/main/JunitMarkdown.java --output ${{ runner.temp }}/JunitMarkdown.java

0 commit comments

Comments
 (0)