Skip to content

perf: PublicCourseService.deletePublicCourses N+1 제거 #57

perf: PublicCourseService.deletePublicCourses N+1 제거

perf: PublicCourseService.deletePublicCourses N+1 제거 #57

Workflow file for this run

name: RUNNECT PROD CI
on:
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
# ν…ŒμŠ€νŠΈ(contextLoads λ“±)λŠ” μ‹€μ œ prod DB/Redisκ°€ μ•„λ‹ˆλΌ CI μ•ˆμ—μ„œ λ„μš°λŠ”
# μž„μ‹œ μ»¨ν…Œμ΄λ„ˆλ₯Ό λ°”λΌλ³΄κ²Œ ν•œλ‹€ (원격 prod ν™˜κ²½μ— 직접 μ˜μ‘΄ν•˜μ§€ μ•Šλ„λ‘).
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: runnect
POSTGRES_USER: runnect
POSTGRES_PASSWORD: runnect_local_password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: make application.properties 파일 생성
run: |
## create application.yml
mkdir -p ./src/main/resources
cd ./src/main/resources
# application.yml 파일 생성
touch ./application.yml
# GitHub-Actions μ—μ„œ μ„€μ •ν•œ 값을 application.yml νŒŒμΌμ— μ“°κΈ°
echo "${{ secrets.RUNNECT_PROD_APPLICATION }}" >> ./application.yml
# application.yml 파일 확인
cat ./application.yml
shell: bash
# 이 μ›Œν¬ν”Œλ‘œμš°λŠ” gradle build
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
env:
SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/runnect
SPRING_DATASOURCE_USERNAME: runnect
SPRING_DATASOURCE_PASSWORD: runnect_local_password
SPRING_DATA_REDIS_HOST: localhost
# PRμ—μ„œ μƒˆλ‘œ μΆ”κ°€/μˆ˜μ •λœ 라인만 컀버리지λ₯Ό κ²€μ‚¬ν•œλ‹€ (전체 컀버리지 κ²Œμ΄νŠΈκ°€ μ•„λ‹˜).
# 둜직이 λ°”λ€Œμ—ˆλŠ”λ° ν…ŒμŠ€νŠΈκ°€ μ•ˆ λ”°λΌμ˜€λŠ” 경우λ₯Ό CIμ—μ„œ κΈ°κ³„μ μœΌλ‘œ 작기 μœ„ν•¨.
- name: Diff coverage 게이트 (λ³€κ²½λœ 라인 κΈ°μ€€)
run: |
pip install diff-cover
diff-cover build/reports/jacoco/test/jacocoTestReport.xml \
--compare-branch=origin/${{ github.base_ref }} \
--fail-under=70