Skip to content

Commit

Permalink
Add Sonarqube analytics #37
Browse files Browse the repository at this point in the history
  • Loading branch information
Bethibande committed May 8, 2024
1 parent 824cc43 commit 12f378c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/test-after-push.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
name: test after push
on: ["push", "workflow_dispatch"]
on: [ "push", "workflow_dispatch" ]
jobs:
test:
runs-on: arc
container:
image: gradle:8.7.0-jdk17
steps:
- uses: actions/checkout@v4
- run: gradle test
- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- run: gradle test
- name: Build and analyze
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew sonar --info
8 changes: 8 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
kotlin("jvm") version "1.9.21" apply false
alias(libs.plugins.sonar)
}

group = "com.bethibande.actors"
Expand All @@ -18,3 +19,10 @@ subprojects {
mavenCentral()
}
}

sonar {
properties {
property("sonar.projectKey", "actors")
property("sonar.projectName", "actors")
}
}
5 changes: 4 additions & 1 deletion versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ kotlinpoet = "1.16.0"

junit = "5.10.2"

sonar = "5.0.0.4638"

[libraries]
kotlinx-coroutines = "org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0-RC2"
kotlin-poet = { module = "com.squareup:kotlinpoet-jvm", version.ref = "kotlinpoet" }
Expand All @@ -23,4 +25,5 @@ junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", vers
junit-jupiter-api = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" }

[plugins]
protobuf = { id = "com.google.protobuf", version.ref = "protobuf" }
protobuf = { id = "com.google.protobuf", version.ref = "protobuf" }
sonar = { id = "org.sonarqube", version.ref = "sonar" }

0 comments on commit 12f378c

Please sign in to comment.