Skip to content

Commit 7e73db0

Browse files
committed
Merge branch 'develop' into feature/comment-read
2 parents f2b5fc2 + db68741 commit 7e73db0

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

.github/workflows/dev-build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: MySQL 컨테이너 실행
3939
run: |
40-
docker run --name test-mysql \
40+
docker run --name log4u-mysql \
4141
-e MYSQL_ROOT_PASSWORD=root \
4242
-e MYSQL_DATABASE=log4u \
4343
-e MYSQL_USER=dev \
@@ -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: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,24 @@ checkstyle {
7878

7979
sonar {
8080
properties {
81-
property("sonar.projectKey", "sapiens2000-dev_simple-sns")
82-
property("sonar.organization", "sapiens2000-dev")
81+
property("sonar.projectKey", "prgrms-web-devcourse-final-project_WEB3_4_Log4U_BE")
82+
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)