File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ name : SonarQube
2+ on :
3+ push :
4+ branches :
5+ - main
6+ pull_request :
7+ types : [opened, synchronize, reopened]
8+ jobs :
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 # Shallow clones should be disabled for a better relevancy of analysis
16+ - name : Set up JDK 17
17+ uses : actions/setup-java@v4
18+ with :
19+ java-version : 17
20+ distribution : ' zulu' # Alternative distribution options are available
21+ - name : Cache SonarQube packages
22+ uses : actions/cache@v4
23+ with :
24+ path : ~/.sonar/cache
25+ key : ${{ runner.os }}-sonar
26+ restore-keys : ${{ runner.os }}-sonar
27+ - name : Cache Gradle packages
28+ uses : actions/cache@v4
29+ with :
30+ path : ~/.gradle/caches
31+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
32+ restore-keys : ${{ runner.os }}-gradle
33+ - name : Build and analyze
34+ env :
35+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
36+ run : ./gradlew build sonar --info
Original file line number Diff line number Diff line change @@ -4,6 +4,13 @@ plugins {
44 id(" se.patrikerdes.use-latest-versions" ) version " 0.2.19"
55 id(" com.github.ben-manes.versions" ) version " 0.53.0"
66 id(" com.diffplug.spotless" ) version " 7.2.1"
7+ id(" org.sonarqube" ) version " 6.3.1.5724"
8+ }
9+ sonar {
10+ properties {
11+ property(" sonar.projectKey" , " Antojkv_java-project-61" )
12+ property(" sonar.organization" , " antojkv" )
13+ }
714}
815
916group = " hexlet.code"
You can’t perform that action at this time.
0 commit comments