File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 18
18
distribution : " liberica"
19
19
cache : " maven"
20
20
21
+ - name : Cache SonarCloud packages
22
+ uses : actions/cache@v3
23
+ with :
24
+ path : ~/.sonar/cache
25
+ key : ${{ runner.os }}-sonar
26
+ restore-keys : ${{ runner.os }}-sonar
27
+
21
28
- name : Verify with Maven
22
- run : mvn verify -B -P prod "-Dstyle.color=always"
29
+ env :
30
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
31
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
32
+ run : |
33
+ # Replace '/' with '_' to get project key
34
+ PROJECT_KEY=${${{ github.repository }}//\//_}
35
+
36
+ mvn verify -B -P prod "-Dstyle.color=always" \
37
+ org.sonarsource.scanner.maven:sonar-maven-plugin:sonar \
38
+ -Dsonar.host.url="https://sonarcloud.io" \
39
+ -Dsonar.organization=${{ github.repository_owner }} \
40
+ -Dsonar.projectKey=$PROJECT_KEY
23
41
24
42
- name : Build and push
25
43
uses : docker/build-push-action@v5
You can’t perform that action at this time.
0 commit comments