Skip to content

Commit

Permalink
Add MySQL service and database migration step
Browse files Browse the repository at this point in the history
  • Loading branch information
FeloxleF committed Mar 16, 2024
1 parent b1ba167 commit fddbe25
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,24 @@ on:
jobs:
build:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:8.3
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: activmind_test
MYSQL_PASSWORD: root
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
max-parallel: 4
matrix:
python-version: [3.9]


env:
MYSQL_HOST: mysql
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -25,16 +38,10 @@ jobs:
run:
python -m pip install --upgrade pip
pip install -r requirements.txt
# - name: Run database migrations
# working-directory: ./activmindback
# run: |
# python manage.py migrate --database=test
- name: Run database migrations
working-directory: ./activmindback
run: |
python manage.py migrate --database=test
- name: Run Tests
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: activmind_test
DJANGO_ALLOWED_HOSTS: localhost 127.0.0.1 [::1]
MYSQL_PASSWORD: root
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
working-directory: ./activmindback
run: python manage.py test

0 comments on commit fddbe25

Please sign in to comment.