Skip to content

Commit

Permalink
feat(sonar): add sonar to project near detekt
Browse files Browse the repository at this point in the history
  • Loading branch information
bas-kirill committed Aug 14, 2024
1 parent 154b367 commit 064323c
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,36 @@ jobs:

- name: Run static analyzer
run: ./tools/scripts/server/runStaticAnalyzer.sh
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@v1
with:
java-version: 17
- 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
- name: Build and analyze
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew build sonar --info

server-unit-tests:
name: "[SERVER] Unit Tests"
runs-on: kiryuxa-3
Expand Down
8 changes: 8 additions & 0 deletions server/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ plugins {
kotlin("plugin.spring") version "1.9.23" // make all classes as `open` for Spring proxies
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
id("io.gitlab.arturbosch.detekt") version "1.23.6"
id("org.sonarqube") version "5.0.0.4638"
}

group = "mu.muse"
Expand Down Expand Up @@ -80,3 +81,10 @@ tasks.withType<Detekt>().configureEach {
html.required.set(true)
}
}

sonar { // self hosted sonar qube
properties {
property("sonar.projectKey", "bas-kirill_muse-project_c40bc999-8826-433b-bb84-8871688b1ab1")
property("sonar.projectName", "muse-project")
}
}

0 comments on commit 064323c

Please sign in to comment.