Skip to content

Commit

Permalink
feat: start mysql service when run github action test
Browse files Browse the repository at this point in the history
  • Loading branch information
narasux committed Sep 4, 2023
1 parent 858fd31 commit 227418c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/bk-user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ jobs:
strategy:
fail-fast: false
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
# The MySQL docker container requires these environment variables to be set
# so we can create and migrate the test database.
# See: https://hub.docker.com/_/mysql
MYSQL_DATABASE: bk-user
MYSQL_ROOT_PASSWORD: mysql_root_pass
ports:
# Opens port 3306 on service container and host
# https://docs.github.com/en/actions/using-containerized-services/about-service-containers
- 3306:3306
# Before continuing, verify the mysql container is reachable from the ubuntu host
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Set up Python
Expand All @@ -58,5 +73,6 @@ jobs:
export BK_APP_SECRET=""
export BK_USER_URL=""
export BK_COMPONENT_API_URL=""
export MYSQL_PASSWORD=mysql_root_pass
export DJANGO_SETTINGS_MODULE=bkuser.settings
poetry run pytest ./tests

0 comments on commit 227418c

Please sign in to comment.