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

[DEV-6] Github Action CI 워크플로우 작성 #2

Merged
merged 3 commits into from
Mar 5, 2024
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
40 changes: 40 additions & 0 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check PR

on:
pull_request

permissions:
checks: write
pull-requests: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

- name: Check Build
run: ./gradlew clean build -x test

- name: Run test
run: ./gradlew test

- name: Add coverage to PR
id: jacoco
uses: madrapps/[email protected]
with:
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 40
min-coverage-changed-files: 60
update-comment: true
title: Test Coverage
pass-emoji: ':green_circle:'
fail-emoji: ':red_circle:'
20 changes: 20 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.2.3'
id 'io.spring.dependency-management' version '1.1.4'
id 'jacoco'
}

group = 'com.tiketeer'
Expand All @@ -11,6 +12,11 @@ java {
sourceCompatibility = '21'
}

jacoco {
toolVersion = "0.8.9"
}


configurations {
compileOnly {
extendsFrom annotationProcessor
Expand All @@ -36,3 +42,17 @@ dependencies {
tasks.named('test') {
useJUnitPlatform()
}

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

jacocoTestReport {
dependsOn test // tests are required to run before generating the report
reports {
xml.required = true
html.required = false
csv.required = false
}
}
Loading