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
19 changes: 18 additions & 1 deletion .github/workflows/develop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,36 @@ jobs:
echo "${{ secrets.ENV_DEV }}" > .env.test
shell: bash

- name: Cache SonarCloud 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: touch dev data.sql
run: |
touch src/main/resources/sql/data.sql
echo "${{ secrets.DATA_SQL }}" > src/main/resources/sql/data.sql
shell: bash

- name: touch test data.sql
run: |
touch src/test/resources/sql/data.sql
echo "${{ secrets.TEST_DATA_SQL }}" > src/test/resources/sql/data.sql
shell: bash

- name: Build and analyze
run: ./gradlew build
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info

- name: Upload Gradle Report
uses: actions/upload-artifact@v4
Expand Down
48 changes: 48 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.4.3'
id 'io.spring.dependency-management' version '1.1.7'
id "org.sonarqube" version "6.2.0.5505"
id 'jacoco'
}

group = 'org.Runimo'
Expand Down Expand Up @@ -60,6 +62,52 @@ dependencies {

}

jacoco {
toolVersion = "0.8.12"
}

jacocoTestReport {
dependsOn test
reports {
xml.required = true
html.required = true
csv.required = false
}
finalizedBy jacocoTestCoverageVerification
}

jacocoTestCoverageVerification {
dependsOn jacocoTestReport
violationRules {
rule {
limit {
minimum = 0.70 // 70% 커버리지 요구
}
}
rule {
enabled = false
element = 'CLASS'
includes = ['org.Runimo.*']
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 200
}
}
}
}

sonar {
properties {
property "sonar.projectKey", "Run-Us_Runimo"
property "sonar.organization", "runimo-backend-server"
property "sonar.host.url", "https://sonarcloud.io"
}
}

tasks.named('test') {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

tasks.sonarqube.dependsOn jacocoTestReport