Skip to content

Coverage/jacoco report PR test #10

Coverage/jacoco report PR test

Coverage/jacoco report PR test #10

Workflow file for this run

name: CI Pipeline
on:
pull_request:
branches:
- test
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build --no-daemon
# 추가
- name: Leave a comment for test coverage
id: jacoco
uses: madrapps/[email protected]
with:
title: 📊 Test Coverage Report
paths: ${{ github.workspace }}/build/reports/jacoco/test/jacocoTestReport.xml # JaCoCo 리포트 위치
token: ${{ github.token }}
min-coverage-overall: 80 # 전체 프로젝트의 커버리지가 80% 이상이어야 통과
min-coverage-changed-files: 80 # 수정된 파일에 대한 최소 커버리지가 80% 이상이어야 통과
pass-emoji: '✅' # 통과 이모지 (default : ":apple:")
# update-comment: true # true로 설정하는 경우 기존 코멘트를 업데이트하는 형태로 동작
# 슬랙 알림 추가
- name: Slack message with build result
if: always()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
if_mention: failure,cancelled
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
test:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Run tests
run: ./gradlew test --no-daemon