Skip to content

Commit

Permalink
feat: 커버리지 결과가 PR에 남도록 한다.
Browse files Browse the repository at this point in the history
  • Loading branch information
kanguk01 committed Nov 15, 2024
1 parent 222d2e7 commit 047d7e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,17 @@ jobs:
generate-summary: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Display Coverage Summary JSON
run: |
cat badges/coverage-summary.json
- name: Extract Coverage Information
if: ${{ github.event_name == 'pull_request' }}
run: |
COVERAGE=$(jq '.coverage' badges/coverage-summary.json)
BRANCH_COVERAGE=$(jq '.branches' badges/coverage-summary.json)
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-X POST \
-d "{\"body\": \"### JaCoCo Test Coverage Summary\n- Coverage: ${COVERAGE}%\n- Branches: ${BRANCH_COVERAGE}%\n\n*Generated by jacoco-badge-generator*\"}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ jacocoTestReport {
'**/config/**', // config 패키지 제외
'**/exception/**', // exception 패키지 제외
'**/core/**', // core 패키지 제외
'**/mapper/**', // mapper 패키지 제외
'**/grpc/**', // grpc 패키지 제외
'**/log/**', // log 패키지 제외
])
})
)
Expand Down

0 comments on commit 047d7e1

Please sign in to comment.