Skip to content

refactor/#137 Admin 백오피스 모듈 분리 및 Facade CQRS 패턴 도입 (#155) #47

refactor/#137 Admin 백오피스 모듈 분리 및 Facade CQRS 패턴 도입 (#155)

refactor/#137 Admin 백오피스 모듈 분리 및 Facade CQRS 패턴 도입 (#155) #47

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: 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%!')
- 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'