Skip to content

Commit

Permalink
ci: 서비스를 통해 mysql 실행
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ503 authored Nov 2, 2023
1 parent 012cd87 commit 1f09f69
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/backend_flyway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'backend')
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: testdb
MYSQL_USER: test
MYSQL_PASSWORD: password
ports:
- 7777:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v3
Expand All @@ -35,9 +46,6 @@ jobs:
- name: chmod gradle
run: chmod +x backend/ddang/gradlew

- name: Set up Docker Compose
run: docker-compose -f .github/workflows/docker-compose.yml up -d

- name: Wait for MySQL to be ready
run: |
while [ -z "$DATABASE_URL" ]; do
Expand All @@ -62,6 +70,3 @@ jobs:
run: |
./gradlew -Dflyway.configFiles=flyway.conf flywayMigrate --stacktrace
working-directory: ./backend/ddang

- name: Shut down Docker Compose
run: docker-compose -f .github/workflows/docker-compose.yml down

0 comments on commit 1f09f69

Please sign in to comment.