From 20f2302fbf72c36e4be6a78f57aa03b3fd5a9d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=82=98=EB=AF=B8?= Date: Wed, 5 Aug 2026 19:56:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20prod=20CI=EA=B0=80=20=EC=9B=90=EA=B2=A9?= =?UTF-8?q?=20DB=20=EB=8C=80=EC=8B=A0=20=EC=9E=84=EC=8B=9C=20postgres/redi?= =?UTF-8?q?s=20=EC=BB=A8=ED=85=8C=EC=9D=B4=EB=84=88=EB=A5=BC=20=EB=B3=B4?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -x test로 테스트를 건너뛰고 있었고, 건너뛰지 않더라도 실제 prod DB에 의존하는 구조였음 (dev-ci에서 이미 겪은 것과 동일한 문제). dev-ci와 동일하게 CI 안에 임시 postgres/redis 컨테이너를 띄우고 그쪽을 보게 수정. --- .github/workflows/prod-ci.yml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/prod-ci.yml b/.github/workflows/prod-ci.yml index f33f87b..4216629 100644 --- a/.github/workflows/prod-ci.yml +++ b/.github/workflows/prod-ci.yml @@ -12,6 +12,32 @@ jobs: 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 - name: Set up JDK 11 @@ -42,4 +68,9 @@ jobs: run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build -x test + 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