fix/#172 관리자 모듈 분리에 따른 테스트 코드 개선 #153
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: Validate Test Coverage and Upload to Codecov On Pull Request | |
on: | |
pull_request: | |
branches: | |
- develop | |
push: | |
branches: | |
- develop | |
permissions: | |
checks: write | |
pull-requests: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: coverage | |
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: 70 | |
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%!') | |
- name: Upload coverage reports to Codecov | |
if: steps.jacoco.outcome == 'success' | |
uses: codecov/codecov-action@v4 | |
continue-on-error: true | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: '**/build/jacoco/test/jacocoTestReport.xml' |