Skip to content

Commit 1f4e287

Browse files
committed
chore: migrate to sonarcloud
1 parent e36379b commit 1f4e287

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,17 @@ jobs:
5050
- name: Upload to Sonatype
5151
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.java == '17'
5252
run: |
53-
./gradlew publishToMavenCentral --no-configuration-cache -PmavenCentralUsername=${ORG_GRADLE_PROJECT_mavenCentralUsername} -PmavenCentralPassword=${ORG_GRADLE_PROJECT_mavenCentralPassword}
53+
./gradlew publishToMavenCentral --no-configuration-cache -PmavenCentralUsername="${ORG_GRADLE_PROJECT_mavenCentralUsername}" -PmavenCentralPassword="${ORG_GRADLE_PROJECT_mavenCentralPassword}"
5454
env:
5555
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
5656
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.MAVEN_GPG_KEYID }}
5757
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
5858
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
5959
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
6060

61-
- name: Upload coverage to Qlty
62-
if: matrix.java == '25'
63-
uses: qltysh/qlty-action/coverage@a19242102d17e497f437d7466aa01b528537e899 # v2.2.0
64-
with:
65-
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
66-
format: jacoco
67-
add-prefix: sshlib/src/main/kotlin/
68-
files: ${{ github.workspace }}/build/reports/kover/report.xml
61+
- name: Run SonarCloud analysis
62+
env:
63+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
if: "${{ matrix.java == '25' && env.SONAR_TOKEN != '' }}"
66+
run: ./gradlew :sshlib:sonar -Dsonar.projectVersion=${{ github.sha }}

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ publish = "0.36.0"
2121
release = "3.1.0"
2222
kover = "0.9.8"
2323
cyclonedx = "3.2.4"
24+
sonarqube = "7.3.0.8198"
2425

2526
[libraries]
2627
kaitai-runtime = { module = "io.kaitai:kaitai-struct-runtime", version.ref = "kaitai" }
@@ -52,3 +53,4 @@ publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }
5253
release = { id = "net.researchgate.release", version.ref = "release" }
5354
kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
5455
cyclonedx = { id = "org.cyclonedx.bom", version.ref = "cyclonedx" }
56+
sonarqube = { id = "org.sonarqube", version.ref = "sonarqube" }

sshlib/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ plugins {
2424
alias(libs.plugins.metalava)
2525
alias(libs.plugins.kover)
2626
alias(libs.plugins.cyclonedx)
27+
alias(libs.plugins.sonarqube)
2728
`java-library`
2829
}
2930

@@ -146,3 +147,12 @@ mavenPublishing {
146147
}
147148
}
148149
}
150+
151+
sonar {
152+
properties {
153+
property("sonar.projectKey", "connectbot_cbssh")
154+
property("sonar.organization", "connectbot")
155+
property("sonar.host.url", "https://sonarcloud.io")
156+
property("sonar.coverage.jacoco.xmlReportPaths", "build/reports/kover/report.xml")
157+
}
158+
}

0 commit comments

Comments
 (0)