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+ on :
2+ push :
3+ branches :
4+ - ' **'
5+ pull_request :
6+ types : [opened, synchronize, reopened]
7+
8+ name : Sonar
9+ jobs :
10+ sonarqube :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
16+ - name : Set up JDK 25
17+ uses : actions/setup-java@v4
18+ with :
19+ distribution : " temurin"
20+ java-version : 25
21+ overwrite-settings : false
22+ - name : Cache SonarQube packages
23+ uses : actions/cache@v4
24+ with :
25+ path : ~/.sonar/cache
26+ key : ${{ runner.os }}-sonar
27+ restore-keys : ${{ runner.os }}-sonar
28+ - name : Cache Maven packages
29+ uses : actions/cache@v4
30+ with :
31+ path : ~/.m2/repository
32+ key : ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
33+ restore-keys : ${{ runner.os }}-maven
34+ - name : Build and analyze
35+ env :
36+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
37+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
38+ SONAR_HOST_URL : ${{ secrets.SONAR_HOST_URL }}
39+ run : |
40+ mkdir -p src/test/resources
41+ echo ${{ secrets.APPLICATION_TEST_PROPERTIES }} | base64 -d > src/test/resources/application-test.properties
42+ mvn clean verify sonar:sonar
Original file line number Diff line number Diff line change 1+ sonar.projectKey =spring_boot_java_random_user
You can’t perform that action at this time.
0 commit comments