Skip to content

Commit

Permalink
deploy: jacoco 테스트 커버리지 분석 적용 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdohyung committed Jul 9, 2024
1 parent 4909ca1 commit e10d0b2
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/pr_text.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: PR Test

on:
pull_request:
branches: [ develop ]

permissions: write-all

jobs:
test:
# 실행 환경
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

# JDK 17
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

# Gradle Caching
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# ./gradlew 권한 설정
- name: ./gradlew 권한 설정
run: chmod +x ./gradlew

# Gradle 테스트 수행
- name: ./gradlew 테스트
run: ./gradlew --info test

# Jacoco Test Coverage Report
- name: Test Coverage Report
id: jacoco
uses: madrapps/[email protected]
with:
title: Test Coverage Report
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 70
min-coverage-changed-files: 70
19 changes: 19 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ plugins {
id 'org.springframework.boot' version '3.1.9'
id 'io.spring.dependency-management' version '1.1.4'
id "org.asciidoctor.jvm.convert" version "3.3.2"
id 'jacoco'
}

group = 'com'
Expand Down Expand Up @@ -131,3 +132,21 @@ bootJar {
}
}
// -------------------

// Jacoco 설정 -------------------
test {
finalizedBy jacocoTestReport
useJUnitPlatform()
}

jacoco {
toolVersion = "0.8.8"
}

jacocoTestReport {
dependsOn test
reports {
xml.required.set(true)
}
}
// -------------------

0 comments on commit e10d0b2

Please sign in to comment.