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 : SonarQube Analysis
2+
3+ on :
4+ push :
5+ branches :
6+ - " **"
7+
8+ jobs :
9+ build :
10+ name : Build and analyze
11+ runs-on : self-hosted
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+ with :
16+ fetch-depth : 0
17+ - name : Set up JDK 17
18+ uses : actions/setup-java@v4
19+ with :
20+ java-version : 17
21+ distribution : ' temurin'
22+
23+ - name : Build with Gradle
24+ run : ./gradlew clean build
25+
26+ - name : Run SonarQube analysis
27+ env :
28+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
29+ SONAR_HOST_URL : ${{ secrets.SONAR_HOST_URL }}
30+ run : ./gradlew sonar --no-daemon
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ plugins {
55 id " maven-publish"
66 id " signing"
77 id " org.jreleaser" version " 1.20.0"
8+ id " org.sonarqube" version " 6.0.1.5171"
89}
910
1011group = ' com.altapay'
@@ -69,6 +70,24 @@ tasks.register("integrationTest", Test) {
6970 useJUnitPlatform()
7071}
7172
73+ sonar {
74+ properties {
75+ property " sonar.projectKey" , " AltaPay_sdk-java_69a0e28c-3133-48fd-8372-6c73a9cba728"
76+ property " sonar.host.url" , System . getenv(" SONAR_HOST_URL" ) ?: System . getProperty(" sonar.host.url" )
77+ property " sonar.token" , System . getenv(" SONAR_TOKEN" ) ?: System . getProperty(" sonar.token" )
78+
79+ property " sonar.scm.disabled" , " true"
80+ property " sonar.cpd.exclusions" , " **/*"
81+ property " sonar.duplications.exclusions" , " **/*"
82+
83+ property " sonar.coverage.exclusions" , " **/*"
84+ property " sonar.java.coveragePlugin" , " none"
85+
86+ // Fail build if Quality Gate fails
87+ property " sonar.qualitygate.wait" , " true"
88+ }
89+ }
90+
7291java {
7392 toolchain {
7493 languageVersion = JavaLanguageVersion . of(17 )
You can’t perform that action at this time.
0 commit comments