Skip to content

Commit 826e4bf

Browse files
authored
Merge pull request #49 from DKU-Dgaja/chore-jacoco-coverage
[CI] chore jacoco coverage
2 parents 6e9d581 + 6a5dad6 commit 826e4bf

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

.github/workflows/CI_dev_be_pull_request.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,16 @@ jobs:
4949
- name: yaml 파일 변경
5050
run: |
5151
echo "${{ secrets.APPLICATION_DEFAULT_DEV }}" > ./backend/src/main/resources/application.yml
52+
53+
coverage:
54+
runs-on: self-hosted
55+
steps:
56+
- name: 테스트 커버리지를 PR에 코멘트로 등록합니다
57+
id: jacoco
58+
uses: madrapps/[email protected]
59+
with:
60+
title: 📝 테스트 커버리지 리포트
61+
paths: ${{ github.workspace }}/backend/build/reports/jacoco/test/jacocoTestReport.xml
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
min-coverage-overall: 50
64+
min-coverage-changed-files: 50

backend/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id 'java'
33
id 'org.springframework.boot' version '3.2.1'
44
id 'io.spring.dependency-management' version '1.1.4'
5+
id 'jacoco'
56
}
67

78
group = 'com.example'
@@ -67,3 +68,20 @@ dependencies {
6768
tasks.named('test') {
6869
useJUnitPlatform()
6970
}
71+
72+
test {
73+
finalizedBy jacocoTestReport
74+
}
75+
76+
jacoco {
77+
toolVersion = "0.8.11" // 버전 명시
78+
}
79+
80+
jacocoTestReport {
81+
dependsOn test
82+
reports {
83+
xml.required.set(true)
84+
csv.required.set(false)
85+
html.required.set(true)
86+
}
87+
}

0 commit comments

Comments
 (0)