From 5e27a6bb0d8eb87545c699684dc733f589643852 Mon Sep 17 00:00:00 2001 From: felix Date: Fri, 15 Mar 2024 23:59:51 -0400 Subject: [PATCH] Add MySQL database setup and migrations --- .github/workflows/django.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 664af2b..143fc2a 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -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: @@ -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