File tree Expand file tree Collapse file tree 2 files changed +45
-2
lines changed
Expand file tree Collapse file tree 2 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 1+ name : SonarQube
2+ on :
3+ push :
4+ pull_request :
5+ types : [opened, synchronize, reopened]
6+ jobs :
7+ build :
8+ name : Build and analyze
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+ with :
13+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
14+ - name : Set up JDK 17
15+ uses : actions/setup-java@v4
16+ with :
17+ java-version : 17
18+ distribution : ' zulu' # Alternative distribution options are available
19+ - name : Cache SonarQube packages
20+ uses : actions/cache@v4
21+ with :
22+ path : ~/.sonar/cache
23+ key : ${{ runner.os }}-sonar
24+ restore-keys : ${{ runner.os }}-sonar
25+ - name : Cache Gradle packages
26+ uses : actions/cache@v4
27+ with :
28+ path : ~/.gradle/caches
29+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
30+ restore-keys : ${{ runner.os }}-gradle
31+ - name : Build and analyze
32+ env :
33+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
34+ run : ./gradlew build sonar --info
Original file line number Diff line number Diff line change 2525plugins {
2626 id ' java'
2727 id ' jacoco'
28+ id ' org.sonarqube' version ' 6.2.0.5505'
2829}
2930
30- group = ' com.interguess'
31- version = ' unknown'
31+ group ' com.interguess'
32+ version ' unknown'
3233
3334java {
3435 toolchain {
@@ -40,6 +41,14 @@ jacoco {
4041 toolVersion = ' 0.8.12'
4142}
4243
44+ sonar {
45+ properties {
46+ property " sonar.projectKey" , " Interguess_auto-impl"
47+ property " sonar.organization" , " interguess"
48+ property " sonar.host.url" , " https://sonarcloud.io"
49+ }
50+ }
51+
4352repositories {
4453 mavenCentral()
4554}
You can’t perform that action at this time.
0 commit comments