diff --git a/.github/workflows/pr_weekly_ci.yml b/.github/workflows/pr_weekly_ci.yml index a2fc914..372f0ca 100644 --- a/.github/workflows/pr_weekly_ci.yml +++ b/.github/workflows/pr_weekly_ci.yml @@ -80,4 +80,6 @@ jobs: with: paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml token: ${{ github.token }} + min-coverage-overall: 70 + min-coverage-changed-files: 70 title: '📊 테스트 커버리지 리포트' diff --git a/build.gradle b/build.gradle index 4e12aab..8c803bb 100644 --- a/build.gradle +++ b/build.gradle @@ -54,12 +54,38 @@ tasks.named('test') { } jacocoTestReport { + dependsOn test // 테스트 실행 후 리포트 생성을 보장 + reports { xml.required = true html.required = true } + + afterEvaluate { + classDirectories.setFrom(files(classDirectories.files.collect { + fileTree(dir: it, exclude: [ + '**/dto/**', + '**/entity/**', + '**/config/**', + '**/exception/**', + '**/*Application.class' + ]) + })) + } } test { + useJUnitPlatform() finalizedBy jacocoTestReport } + +// 테스트 커버리지 최소 기준 설정 +jacocoTestCoverageVerification { + violationRules { + rule { + limit { + minimum = 0.70 + } + } + } +}