File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : SonarCloud
1+ name : Build
22on :
3- push :
4- branches : [ main ]
5- pull_request :
6- types : [opened, synchronize, reopened]
7-
3+ push :
4+ branches :
5+ - main
6+ pull_request :
7+ types : [opened, synchronize, reopened]
88jobs :
9- build :
10- name : Build and analyze
11- runs-on : ubuntu-latest
12- steps :
13- - uses : actions/checkout@v4
14- with :
15- fetch-depth : 0
16-
17- - name : Set up JDK 17
18- uses : actions/setup-java@v4
19- with :
20- java-version : " 17 "
21- distribution : " zulu "
22- cache : maven
23-
24- - name : Cache Sonar packages
25- uses : actions/cache@v4
26- with :
27- path : ~/.sonar/ cache
28- key : ${{ runner.os }}-sonar
29- restore-keys : ${{ runner.os }}-sonar
30-
31- - name : Build and analyze
32- env :
33- SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
34- run :
35- mvn -B -U verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
9+ build :
10+ name : Build
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v6
14+ with :
15+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
16+ - name : Set up JDK 17
17+ uses : actions/setup-java@v1
18+ with :
19+ java-version : 17
20+ - name : Cache SonarQube packages
21+ uses : actions/cache@v4
22+ with :
23+ path : ~/.sonar/cache
24+ key : ${{ runner.os }}-sonar
25+ restore-keys : ${{ runner.os }}-sonar
26+ - name : Cache Maven packages
27+ uses : actions/ cache@v4
28+ with :
29+ path : ~/.m2
30+ key : ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
31+ restore-keys : ${{ runner.os }}-m2
32+ - name : Build and analyze
33+ env :
34+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
35+ run : mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
You can’t perform that action at this time.
0 commit comments