Skip to content

chore-be(Actions-CI): gradlew 권한 할당 path 수정 #25

chore-be(Actions-CI): gradlew 권한 할당 path 수정

chore-be(Actions-CI): gradlew 권한 할당 path 수정 #25

name: BE/CI - Test Coverage 검증
on:
workflow_dispatch:
pull_request:
types: [opened, ready_for_review]
branches:
- be/develop
jobs:
test-coverage-pr-opened:
defaults:
run:
working-directory: ./backend
if: startsWith(github.head_ref, 'be-')
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: backend
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache Gradle wrapper
uses: actions/cache@v3
with:
path: |
~/backend/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Cache Gradle dependencies
uses: actions/cache@v3
with:
path: |
~/backend/.gradle/caches
~/backend/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle-wrapper.properties', '**/settings.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Grant execute permission for gradlew
run: |
cd backend
chmod +x gradlew
- name: Run tests and generate coverage report
env:
JAVA_HOME: ${{ steps.setup-java.outputs.java-home }}
run: ./backend/gradlew test jacocoTestReport
continue-on-error: true
- name: Verify test coverage
env:
JAVA_HOME: ${{ steps.setup-java.outputs.java-home }}
run: ./backend/gradlew jacocoTestCoverageVerification
continue-on-error: true
- name: 테스트 커버리지를 PR에 코멘트로 등록
uses: madrapps/jacoco-report@v1.6.1
with:
title: 📌 Test Coverage Report
paths: backend/build/reports/jacoco/test/jacocoTestReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 80
min-coverage-changed-files: 80