Skip to content

Commit 8baf120

Browse files
authored
Add Maven cache (#127)
1 parent 555a1ec commit 8baf120

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

.github/workflows/pull_request.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ jobs:
2323
distribution: 'temurin'
2424
cache: maven
2525

26+
- name: Cache SonarQube packages
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.sonar/cache
30+
key: ${{ runner.os }}-sonar
31+
restore-keys: ${{ runner.os }}-sonar
32+
33+
- name: Cache Maven packages
34+
uses: actions/cache@v4
35+
with:
36+
path: ~/.m2
37+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
38+
restore-keys: ${{ runner.os }}-m2
39+
2640
- name: Check style
2741
run: mvn checkstyle:check
2842

.github/workflows/push_master.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ jobs:
2222
distribution: 'temurin'
2323
cache: maven
2424

25+
- name: Cache SonarQube packages
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.sonar/cache
29+
key: ${{ runner.os }}-sonar
30+
restore-keys: ${{ runner.os }}-sonar
31+
32+
- name: Cache Maven packages
33+
uses: actions/cache@v4
34+
with:
35+
path: ~/.m2
36+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
37+
restore-keys: ${{ runner.os }}-m2
38+
2539
- name: Check style
2640
run: mvn checkstyle:check
2741

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
distribution: 'temurin'
2323
cache: maven
2424

25+
- name: Cache Maven packages
26+
uses: actions/cache@v4
27+
with:
28+
path: ~/.m2
29+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
30+
restore-keys: ${{ runner.os }}-m2
31+
2532
- name: Package application
2633
run: mvn -B -DskipTests package -P production
2734

0 commit comments

Comments
 (0)