Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHORE] CI 스크립트 작성 #21

Merged
merged 14 commits into from
Dec 15, 2024
61 changes: 61 additions & 0 deletions .github/workflows/Dev_CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: dev-ci

on:
pull_request:
branches:
- develop

permissions:
contents: read
checks: write
pull-requests: write

jobs:
build-and-push:
runs-on: ubuntu-latest
timeout-minutes: 3
env:
TEST_REPORT: true

steps:
- uses: actions/checkout@v4

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

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Grant Permission
run: chmod +x ./gradlew

- name: Clean And Test With Gradle
run: ./gradlew clean test

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: ${{ github.workspace }}/build/test-results/**/*.xml

- name: JUnit Report Action
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: ${{ github.workspace }}/build/test-results/**/*.xml

- name: Report test Coverage to PR
id: jacoco
uses: madrapps/[email protected]
if: always()
with:
title: 📝 Test Coverage Report
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80
update-comment: true
debug-mode: true
27 changes: 27 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'java'
id 'jacoco'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
}
Expand Down Expand Up @@ -39,6 +40,32 @@ dependencies {
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.6.0'
}

jacoco {
toolVersion = '0.8.9'
}

tasks.named('test') {
useJUnitPlatform()
finalizedBy jacocoTestReport
}

jacocoTestReport {
dependsOn test
reports {
xml.required.set(true)
csv.required.set(false)
html.required.set(false)
}

afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"com/debatetimer/**/dto/**"
])
}))
}

onlyIf {
return System.getenv('TEST_REPORT') == 'true'
}
}
1 change: 1 addition & 0 deletions src/lombok.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lombok.addLombokGeneratedAnnotation = true
Loading