Update Sonar CI action

This commit is contained in:
grimsi 2026-02-01 12:44:43 +01:00
parent b4c9fa3336
commit 13527767bc
3 changed files with 9 additions and 6 deletions

View File

@ -35,10 +35,10 @@ jobs:
restore-keys: ${{ runner.os }}-sonar
- name: Run tests and generate JaCoCo report
run: ./gradlew test jacocoTestReport
run: ./gradlew :app:test :app:jacocoTestReport
- name: SonarCloud Scan
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar
run: ./gradlew :app:sonar

View File

@ -110,20 +110,23 @@ tasks.withType<Test> {
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required = true
xml.outputLocation = layout.buildDirectory.file("reports/jacoco/test/jacocoTestReport.xml")
}
}
tasks.named("sonar") {
dependsOn(tasks.jacocoTestReport)
}
sonar {
properties {
property("sonar.projectKey", "gameyfin")
property("sonar.organization", "gameyfin")
property("sonar.host.url", "https://sonarcloud.io")
property(
"sonar.coverage.jacoco.xmlReportPaths",
"${layout.buildDirectory.get()}/reports/jacoco/test/jacocoTestReport.xml"
)
property("sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml")
}
}

Binary file not shown.