Skip to content

Commit a5e6bd8

Browse files
Fix Sonarcloud workflow
1 parent a217302 commit a5e6bd8

File tree

1 file changed

+28
-9
lines changed

1 file changed

+28
-9
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,35 @@ jobs:
1616
sonarqube:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v4
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
2021
with:
2122
fetch-depth: 0
22-
- name: SonarQube Scan
23-
uses: SonarSource/[email protected]
23+
24+
- name: Set up JDK
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: 'temurin'
28+
java-version: '21'
29+
30+
- name: Cache SonarQube packages
31+
uses: actions/cache@v4
32+
with:
33+
path: ~/.sonar/cache
34+
key: ${{ runner.os }}-sonar
35+
restore-keys: ${{ runner.os }}-sonar
36+
37+
- name: Cache Maven packages
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.m2
41+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
42+
restore-keys: ${{ runner.os }}-m2
43+
44+
- name: Build and analyze
2445
env:
2546
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
26-
with:
27-
projectBaseDir: .
28-
args: >
29-
-Dsonar.projectKey=ComputerDaddyGuy_JFileTreePrettyPrinter
30-
-Dsonar.organization=computerdaddyguy
31-
47+
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
48+
-Dsonar.host.url=https://sonarcloud.io \
49+
-Dsonar.organization=computerdaddyguy \
50+
-Dsonar.projectKey=ComputerDaddyGuy_JFileTreePrettyPrinter

0 commit comments

Comments
 (0)