Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: SonarQube
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available
- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info
7 changes: 7 additions & 0 deletions app/src/desktopTest/kotlin/net/cacheux/nvp/app/CsvTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@ import net.cacheux.nvp.app.utils.csvToDoseList
import net.cacheux.nvp.app.utils.toCsv
import net.cacheux.nvp.model.Dose
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import java.time.LocalDateTime
import java.time.ZoneOffset
import java.util.TimeZone

class CsvTest {
@Before
fun init() {
TimeZone.setDefault(TimeZone.getTimeZone("Europe/Paris"))
}

@Test
fun testToCsv() {

Expand Down
11 changes: 10 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ plugins {
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.sonarqube)
signing
}

val localProperties by extra { Properties().apply {
load(File("$rootDir/local.properties").inputStream())
if (File("$rootDir/local.properties").exists())
load(File("$rootDir/local.properties").inputStream())
} }

val gpgSigningAvailable = listOf("gpgSigningKey", "gpgSigningPass").map {
Expand All @@ -34,3 +36,10 @@ val signingIfAvailable by extra {
}
}
}

sonar {
properties {
property("sonar.projectKey", "lcacheux_nov-open-reader")
property("sonar.organization", "lcacheux")
}
}
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ room = { id = "androidx.room", version.ref = "room" }
jetbrains-compose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version = "2.0.0" }
sonarqube = { id = "org.sonarqube", version = "6.3.1.5724" }

[libraries]
colorpicker-compose = { module = "com.github.skydoves:colorpicker-compose", version = "1.1.2" }
Expand Down