feature/#126 Jacoco를 사용한 테스트 커버리지 측정 #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Jacoco Validation Pull Request On Dev | |
on: | |
pull_request: | |
branches: | |
- develop | |
permissions: | |
checks: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Test with Gradle | |
run: ./gradlew test | |
- name: Test Coverage Report | |
id: jacoco | |
uses: madrapps/[email protected] | |
with: | |
title: Test Coverage Report | |
paths: | | |
${{ github.workspace }}/aics-domain/build/jacoco/test/jacocoTestReport.xml | |
${{ github.workspace }}/aics-api/build/jacoco/test/jacocoTestReport.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
min-coverage-overall: 80 | |
min-coverage-changed-files: 80 | |
update-comment: true | |
- name: Fail PR if overall coverage is less than 80% | |
if: ${{ steps.jacoco.outputs.coverage-overall < 80.0 }} | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
core.setFailed('Overall coverage is less than 80%!') |