Skip to content

Commit

Permalink
Add MySQL database setup and migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
FeloxleF committed Mar 16, 2024
1 parent 92520a2 commit 5e27a6b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0.31
env:
MYSQL_ROOT_PASSWORD: root # Remplacez ceci par votre mot de passe root MySQL
MYSQL_DATABASE: activmind # Remplacez ceci par le nom de votre base de données
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
max-parallel: 4
matrix:
Expand All @@ -32,6 +26,12 @@ jobs:
run:
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Set up MySQL Database
run: |
python -m pip install mysql-connector-python
python -c "import mysql.connector; conn = mysql.connector.connect(user='root', password='root', host='localhost', port='3306', database='activmind'); cursor = conn.cursor(); cursor.execute('CREATE DATABASE IF NOT EXISTS activmind')"
python manage.py makemigrations
python manage.py migrate
- name: Run Tests
working-directory: ./activmindback
run: python manage.py test

0 comments on commit 5e27a6b

Please sign in to comment.