Skip to content

Commit 0488978

Browse files
authored
Update maven.yml
1 parent 8a6ae82 commit 0488978

File tree

1 file changed

+18
-30
lines changed

1 file changed

+18
-30
lines changed

.github/workflows/maven.yml

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,13 @@ jobs:
1515
java: [11, 17]
1616

1717
steps:
18-
- uses: actions/checkout@v2
19-
- name: Set up JDK ${{ matrix.java }}
20-
uses: actions/setup-java@v1
18+
- uses: actions/checkout@v3
19+
- name: Set up JDK ${{ matrix.java }}
20+
uses: actions/setup-java@v3
2121
with:
22-
java-version: ${{ matrix.java }}
23-
- name: Cache Maven packages
24-
uses: actions/cache@v1
25-
with:
26-
path: ~/.m2
27-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
28-
restore-keys: ${{ runner.os }}-m2
22+
distribution: 'temurin'
23+
java-version: ${{ matrix.java }}
24+
cache: 'maven'
2925
- name: Build with Maven
3026
run: mvn test jacoco:report --file pom.xml -B
3127

@@ -42,43 +38,35 @@ jobs:
4238
java: [11, 17]
4339

4440
steps:
45-
- uses: actions/checkout@v2
46-
- name: Set up JDK ${{ matrix.java }}
47-
uses: actions/setup-java@v1
48-
with:
49-
java-version: ${{ matrix.java }}
50-
- name: Cache Maven packages
51-
uses: actions/cache@v1
41+
- uses: actions/checkout@v3
42+
- name: Set up JDK ${{ matrix.java }}
43+
uses: actions/setup-java@v3
5244
with:
53-
path: ~/.m2
54-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
55-
restore-keys: ${{ runner.os }}-m2
45+
distribution: 'temurin'
46+
java-version: ${{ matrix.java }}
47+
cache: 'maven'
5648
- name: Build with Maven
5749
run: mvn package --file pom.xml -B
5850

5951
build-sonar:
6052
name: Build
6153
runs-on: ubuntu-latest
6254
steps:
63-
- uses: actions/checkout@v2
55+
- uses: actions/checkout@v3
6456
with:
6557
fetch-depth: 0
6658
- name: Set up JDK 11
67-
uses: actions/setup-java@v1
59+
uses: actions/setup-java@v3
6860
with:
69-
java-version: 11
61+
distribution: 'temurin'
62+
java-version: 11
63+
cache: 'maven'
7064
- name: Cache SonarCloud packages
71-
uses: actions/cache@v1
65+
uses: actions/cache@v3
7266
with:
7367
path: ~/.sonar/cache
7468
key: ${{ runner.os }}-sonar
7569
restore-keys: ${{ runner.os }}-sonar
76-
- name: Cache Maven packages
77-
uses: actions/cache@v1
78-
with:
79-
path: ~/.m2
80-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
81-
restore-keys: ${{ runner.os }}-m2
8270
- name: Build and analyze
8371
env:
8472
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)