File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 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 : |
Original file line number Diff line number Diff line change @@ -78,11 +78,24 @@ checkstyle {
7878
7979sonar {
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}
You can’t perform that action at this time.
0 commit comments