Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/jacoco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: PR Test

on:
pull_request:
types: [ opened, synchronize, reopened ]

permissions: write-all

jobs:
test:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Create .env file for CI environment
run: echo "${{ secrets.ENV_FILE_CONTENT }}" > .env

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Test with Gradle
run: ./gradlew test

- name: Test Coverage Report
id: jacoco
uses: madrapps/jacoco-report@v1.7.1
with:
title: Test Coverage Report
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 50
min-coverage-changed-files: 70
26 changes: 26 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'java'
id 'org.springframework.boot' version '3.4.5'
id 'io.spring.dependency-management' version '1.1.7'
id 'jacoco'
}

group = 'run'
Expand Down Expand Up @@ -38,3 +39,28 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

test {
finalizedBy jacocoTestReport
}

jacoco {
toolVersion = "0.8.12"
}

jacocoTestReport {
dependsOn test
reports {
xml.required.set(true)
}
afterEvaluate {
classDirectories.setFrom(
files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
'**/Q*.class',
'**/run/backend/BackendApplication.class'
Comment on lines +60 to +61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기에 제외할 클래스 넣으면 되는거군요!

])
})
)
}
}
1 change: 1 addition & 0 deletions lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
13 changes: 0 additions & 13 deletions src/test/java/run/backend/BackendApplicationTests.java

This file was deleted.