Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
[WEAV-16] ๐Ÿ”ง SonarCloud ๊ด€๋ จ ์„ค์ • (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
waterfogSW authored Jan 19, 2024
1 parent 4155ff7 commit 30fba82
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/sonar_cloud.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: SonarCloud
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: corretto
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build And analyze Http Server
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew :bootstrap:http:build sonar --info
2 changes: 2 additions & 0 deletions bootstrap/http/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ dependencies {
implementation(project(":application"))
implementation(project(":infrastructure:client"))
implementation(project(":infrastructure:persistence"))

implementation("org.springframework.boot:spring-boot-starter-web:${Version.SPRING_BOOT}")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.studentcenter.weave.bootstrap

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
class WeaveHttpApplication

fun main(args: Array<String>) {
runApplication<WeaveHttpApplication>(*args)
}
10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
`java-test-fixtures`
id("org.sonarqube") version Version.SONAR_CLOUD
id("org.springframework.boot") version Version.SPRING_BOOT
id("io.spring.dependency-management") version Version.SPRING_BOOT_DEPENDENCY_MANAGEMENT
kotlin("jvm") version Version.KOTLIN
Expand All @@ -20,6 +21,7 @@ allprojects {

subprojects {
apply(plugin = "java-test-fixtures")
apply(plugin = "org.sonarqube")
apply(plugin = "idea")
apply(plugin = "kotlin")
apply(plugin = "kotlin-spring")
Expand Down Expand Up @@ -71,3 +73,11 @@ subprojects {
}

}

sonar {
properties {
property("sonar.projectKey", "Student-Center_weave-server")
property("sonar.organization", "student-center")
property("sonar.host.url", "https://sonarcloud.io")
}
}
1 change: 1 addition & 0 deletions buildSrc/src/main/kotlin/Version.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ object Version {
const val SPRING_BOOT = "3.2.1"
const val SPRING_BOOT_DEPENDENCY_MANAGEMENT = "1.1.4"
const val KOTLIN = "1.9.21"
const val SONAR_CLOUD = "4.4.1.3373"

// dependencies
const val MOCKK = "1.13.7"
Expand Down

0 comments on commit 30fba82

Please sign in to comment.