File tree 3 files changed +78
-1
lines changed
3 files changed +78
-1
lines changed Original file line number Diff line number Diff line change 4
4
branches-ignore :
5
5
- master
6
6
pull_request :
7
-
7
+ types : [opened, synchronize, reopened]
8
8
jobs :
9
9
validation :
10
10
name : Gradle Wrapper Validation
49
49
if : matrix.os == 'windows-latest'
50
50
shell : cmd
51
51
run : gradlew --info check
52
+ build :
53
+ name : Sonar analysis
54
+ needs : validation
55
+ runs-on : ubuntu-latest
56
+ steps :
57
+ - uses : actions/checkout@v2
58
+ with :
59
+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
60
+ - name : Set up JDK 11
61
+ uses : actions/setup-java@v1
62
+ with :
63
+ java-version : 11
64
+ - name : Cache SonarCloud packages
65
+ uses : actions/cache@v1
66
+ with :
67
+ path : ~/.sonar/cache
68
+ key : ${{ runner.os }}-sonar
69
+ restore-keys : ${{ runner.os }}-sonar
70
+ - name : Cache Gradle packages
71
+ uses : actions/cache@v1
72
+ with :
73
+ path : ~/.gradle/caches
74
+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
75
+ restore-keys : ${{ runner.os }}-gradle
76
+ - name : Build and analyze
77
+ env :
78
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
79
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
80
+ run : ./gradlew build jacocoTestReport sonarqube --info
Original file line number Diff line number Diff line change 66
66
BINTRAY_USER : ${{ secrets.BINTRAY_USER }}
67
67
BINTRAY_PASS : ${{ secrets.BINTRAY_PASSWORD }}
68
68
run : ./gradlew artifactoryPublish -Dsnapshot=true -Dbuild.number=${{ env.GITHUB_RUN_NUMBER }}
69
+ sonar :
70
+ name : Sonar analysis
71
+ needs : validation
72
+ runs-on : ubuntu-latest
73
+ steps :
74
+ - uses : actions/checkout@v2
75
+ with :
76
+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
77
+ - name : Set up JDK 11
78
+ uses : actions/setup-java@v1
79
+ with :
80
+ java-version : 11
81
+ - name : Cache SonarCloud packages
82
+ uses : actions/cache@v1
83
+ with :
84
+ path : ~/.sonar/cache
85
+ key : ${{ runner.os }}-sonar
86
+ restore-keys : ${{ runner.os }}-sonar
87
+ - name : Cache Gradle packages
88
+ uses : actions/cache@v1
89
+ with :
90
+ path : ~/.gradle/caches
91
+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
92
+ restore-keys : ${{ runner.os }}-gradle
93
+ - name : Build and analyze
94
+ env :
95
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
96
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
97
+ run : ./gradlew build jacocoTestReport sonarqube --info
Original file line number Diff line number Diff line change @@ -37,10 +37,22 @@ plugins {
37
37
id ' io.franzbecker.gradle-lombok' version ' 3.2.0' apply false
38
38
id " com.jfrog.artifactory" version " 4.11.0" apply false
39
39
id " biz.aQute.bnd.builder" version " 5.1.2" apply false
40
+ id " org.sonarqube" version " 3.0"
41
+ id " jacoco"
42
+ }
43
+
44
+ sonarqube {
45
+ properties {
46
+ property " sonar.projectKey" , " graphql-java-kickstart_graphql-java-servlet"
47
+ property " sonar.organization" , " graphql-java-kickstart"
48
+ property " sonar.host.url" , " https://sonarcloud.io"
49
+ }
40
50
}
41
51
42
52
subprojects {
43
53
apply plugin : ' idea'
54
+ apply plugin : ' jacoco'
55
+ apply plugin : ' org.sonarqube'
44
56
apply plugin : ' java'
45
57
apply plugin : ' maven-publish'
46
58
apply plugin : " com.jfrog.bintray"
@@ -75,6 +87,13 @@ subprojects {
75
87
sha256 = " "
76
88
}
77
89
90
+ jacocoTestReport {
91
+ reports {
92
+ xml. enabled = true
93
+ html. enabled = false
94
+ csv. enabled = false
95
+ }
96
+ }
78
97
79
98
if (! it. name. startsWith(' example' )) {
80
99
You can’t perform that action at this time.
0 commit comments