Merge branch 'sonar-qube'

This commit is contained in:
aminecmi 2022-12-13 21:49:19 +01:00
commit 527830a5ae
3 changed files with 17 additions and 18 deletions

View File

@ -3,27 +3,34 @@ type: docker
name: test
steps:
- name: AnylyseBuildTest
- name: BuildAndTest
image: mingc/android-build-box:latest
commands:
- echo "---------------------------------------------------------"
- echo "Configure gradle..."
- mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true\npushCache=false\nsystemProp.org.gradle.internal.http.connectionTimeout=180000\nsystemProp.org.gradle.internal.http.socketTimeout=180000" >> ~/.gradle/gradle.properties
- echo "---------------------------------------------------------"
- echo "Analysing..."
- ./gradlew koverMergedXmlReport && ./gradlew sonarqube -Dsonar.projectKey=RFS2 -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN
- echo "---------------------------------------------------------"
- echo "Building..."
- ./gradlew build -x test
- echo "---------------------------------------------------------"
- echo "Testing..."
- echo "---------------------------------------------------------"
- ./gradlew test
- ./gradlew koverMergedXmlReport
environment:
SONAR_HOST_URL:
from_secret: sonarScannerHostUrl
SONAR_LOGIN:
from_secret: sonarScannerLogin
- name: Analyse
image: kytay/sonar-node-plugin
settings:
sonar_host:
from_secret: sonarScannerHostUrl
sonar_token:
from_secret: sonarScannerLogin
use_node_version: 16.18.1
sonar_debug: true
sonar_project_settings: ./sonar-project.properties
trigger:
event:
- push

View File

@ -11,13 +11,10 @@ plugins {
id("com.android.library").version("7.3.1").apply(false)
kotlin("android").version("1.7.20").apply(false)
kotlin("multiplatform").version("1.7.20").apply(false)
id("org.sonarqube").version("3.4.0.2513")
id("com.mikepenz.aboutlibraries.plugin").version("10.5.1").apply(false)
id("org.jetbrains.kotlinx.kover") version "0.6.1"
}
apply(plugin = "org.sonarqube")
allprojects {
repositories {
google()
@ -32,16 +29,6 @@ tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
sonarqube {
properties {
property("sonar.coverage.jacoco.xmlReportPaths", "${rootProject.buildDir}/reports/kover/merged/xml/report.xml")
}
}
project.tasks["sonarqube"].dependsOn "koverMergedXmlReport"
koverMerged {
enable()
}

5
sonar-project.properties Normal file
View File

@ -0,0 +1,5 @@
sonar.projectKey=RFS2
sonar.coverage.jacoco.xmlReportPaths=build/reports/kover/merged/xml/report.xml
sonar.sourceEncoding=UTF-8
sonar.sources=.
sonar.exclusions=shared/src/iosArm64Main/**, shared/src/iosX64Main/**, docs/**