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

[OING-27] chore: 배포 파이프라인 이후 슬랙 알림 보내기 #11

Closed
wants to merge 1 commit into from
Closed
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
52 changes: 52 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: 테스트 커버리지 워크플로우
on:
pull_request:
branches:
- master
- dev
- 'release/**'

env:
COVERAGE_PERCENT: 30

jobs:
build:
runs-on: [ ubuntu-latest ]
steps:
- name: GitHub 에서 레포 받아오기
uses: actions/checkout@v3

- name: JDK17 준비하기
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: 커버리지 측정하기
run: |
chmod +x gradlew
./gradlew --info test

- name: 테스트 결과 업로드
uses: EnricoMi/publish-unit-test-result-action@v1
if: ${{ always() }}
with:
files: build/test-results/**/*.xml

- name: 커버리지 결과 PR에 업로드
id: jacoco
uses: madrapps/[email protected]
with:
paths: ${{ github.workspace }}/build/reportsJaCoCo/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: ${{ env.COVERAGE_PERCENT }}
debug-mode: false
title: Code Coverage
update-comment: true

- name: ${{ env.COVERAGE_PERCENT }}% 이하 커버리지 블로킹
if: ${{ steps.jacoco.outputs.coverage-overall < env.COVERAGE_PERCENT }}
uses: actions/github-script@v6
with:
script: |
core.setFailed('Overall coverage is less than ${{ env.COVERAGE_PERCENT }}%!')
Loading