Skip to content

chore: Swagger 의존성 버전업 및 기본 설정 적용 #5

chore: Swagger 의존성 버전업 및 기본 설정 적용

chore: Swagger 의존성 버전업 및 기본 설정 적용 #5

Workflow file for this run

name: CI with Gradle
on:
pull_request:
branches:
- main
permissions:
contents: read
checks: write
pull-requests: write
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
GITHUB_SHA: ${{ github.sha }}
jobs:
build:
# ubuntu 버전 지정
runs-on: ubuntu-22.04
steps:
# Checkout 진행
- uses: actions/checkout@v3
# JDK 11 설치
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
# Gradle 캐싱
- name: Gradle Caching
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Gradle 권한 부여
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# api yml 반영
- name: Make application.yml
run: |
cd ./api-module/src/main/resources
touch ./application.yml
echo "${{ secrets.APPLICATION_SECRET }}" > ./application.yml
shell: bash
# common yml 반영
- name: Make application-common.yml
run: |
cd ./common-module/src/main/resources
touch ./application-common.yml
echo "${{ secrets.APPLICATION_COMMON }}" > ./application-common.yml
shell: bash
# domain yml 반영
- name: Make application-domain.yml
run: |
cd ./domain-module/src/main/resources
touch ./application-domain.yml
echo "${{ secrets.APPLICATION_DOMAIN }}" > ./application-domain.yml
shell: bash
# infra yml 반영
- name: Make application-infra.yml
run: |
cd ./infra-module/src/main/resources
touch ./application-infra.yml
echo "${{ secrets.APPLICATION_INFRA }}" > ./application-infra.yml
shell: bash
# clean과 test를 한 번에 실행
- name: Test with Gradle
run: ./gradlew clean test
# Jacoco 통합 리포트 생성 후 업로드
- name: Generate Jacoco Root Report
run: ./gradlew jacocoRootReport
if: always()
# bootJar 실행해서 jar 파일 생성 여부 확인
- name: Build with Gradle
run: ./gradlew api-module:bootJar
# Test 결과 업로드
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
if: always()
with:
files: '**/build/test-results/test/TEST-*.xml'
- name: JUnit Report Action
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/build/test-results/test/TEST-*.xml'
- name: Report test Coverage to PR
id: jacoco
uses: madrapps/jacoco-report@v1.6.1
if: always()
continue-on-error: true # 실패해도 다음 단계 진행 (TODO: 커버리지 기준 충족 못할 시 실패 처리로 변경 예정)
with:
title: 📝 Test Coverage Report
paths: |
${{ github.workspace }}/build/reports/jacoco/jacocoRootReport/jacocoRootReport.xml
token: ${{ secrets.GITHUB_TOKEN }}
min-coverage-overall: 70
min-coverage-changed-files: 70
update-comment: true