-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (34 loc) · 1.08 KB
/
ci-merge.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Check test coverage and merge
on:
pull_request:
branches: [ main, develop ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: "JDK17 준비하기"
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: "Gradle 준비하기"
run: chmod +x gradlew
- name: "test 실행"
run: ./gradlew clean build -x test
- name: "Codecov에 커버리지 업로드"
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: "test 결과 PR 코멘트로 등록"
uses: EnricoMi/publish-unit-test-result-action@v1
if: ${{ always() }}
with:
files: build/test-results/**/*.xml
- name: "커버리지 통과 여부 확인"
run: |
COVERAGE=$(./gradlew jacocoTestReport --console=plain | grep -Po 'Total.*?\K[0-9]+(?=%)')
echo "Coverage is ${COVERAGE}%"
if [ $COVERAGE -lt 70 ]; then
echo "Test coverage is below 70%"
exit 1
fi