diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 7a3452b..7313df9 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -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 }} @@ -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