Skip to content

Commit 86d6add

Browse files
committed
Merge branch 'develop' into feature/diary
2 parents fc1a79c + db68741 commit 86d6add

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

.github/workflows/dev-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ jobs:
5757
# dev 프로필 사용
5858
run: |
5959
chmod +x ./gradlew
60-
./gradlew build jacocoTestReport sonar --info -Pprofile=dev -Dsonar.branch.name=${{ github.ref_name }}
60+
# 소나클라우드 임시 비활성화 ./gradlew build jacocoTestReport sonar --info -Pprofile=dev -Dsonar.branch.name=${{ github.ref_name }}
61+
./gradlew build jacocoTestReport -Pprofile=dev
6162
6263
- name: Docker MySQL 종료 및 제거
6364
run: |

build.gradle.kts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,24 @@ checkstyle {
7878

7979
sonar {
8080
properties {
81-
property("sonar.projectKey", "WEB3_4_Log4U_BE")
81+
property("sonar.projectKey", "prgrms-web-devcourse-final-project_WEB3_4_Log4U_BE")
8282
property("sonar.organization", "prgrms-web-devcourse-final-project")
8383
property("sonar.host.url", "https://sonarcloud.io")
84-
property("sonar.coverage.jacoco.xmlReportPaths", "build/reports/jacoco/test/jacocoTestReport.xml")
85-
property("sonar.java.checkstyle.reportPaths", "build/reports/checkstyle/main.xml")
86-
property("sonar.branch.name", System.getenv("BRANCH_NAME") ?: "main")
84+
85+
// Jacoco 리포트가 존재하는지 확인 후 적용
86+
val jacocoReportPath = file("build/reports/jacoco/test/jacocoTestReport.xml")
87+
if (jacocoReportPath.exists()) {
88+
property("sonar.coverage.jacoco.xmlReportPaths", jacocoReportPath.absolutePath)
89+
}
90+
91+
// Checkstyle 리포트가 존재하는지 확인 후 적용
92+
val checkstyleReportPath = file("build/reports/checkstyle/main.xml")
93+
if (checkstyleReportPath.exists()) {
94+
property("sonar.java.checkstyle.reportPaths", checkstyleReportPath.absolutePath)
95+
}
96+
97+
// 환경 변수 `BRANCH_NAME`이 없을 경우 "main"으로 설정
98+
val branchName = System.getenv("BRANCH_NAME") ?: "main"
99+
property("sonar.branch.name", branchName)
87100
}
88101
}

0 commit comments

Comments
 (0)