Skip to content
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/pod_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,25 @@ jobs:
Pod-Dev:
runs-on: ubuntu-latest

env:
DATABASE_HOST: localhost
DATABASE_PORT: '3306'
DATABASE_NAME: pod
DATABASE_USER: root
DATABASE_PASSWORD: root

steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}

- name: Start MySQL Server
run: |
sudo systemctl start mysql.service
mysql -u root -proot -e "CREATE DATABASE pod CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"

- name: Configure sysctl limits (for ES)
run: |
sudo swapoff -a
Expand All @@ -62,6 +74,8 @@ jobs:
sudo rm -rf /var/lib/apt/lists/*
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
# ensure mysqlclient is available
pip install mysqlclient
sudo npm install -g yarn

# FLAKE 8 (see setup.cfg for configurations)
Expand Down
20 changes: 20 additions & 0 deletions pod/custom/settings_local_docker_full_test.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

DEBUG = True

TEST_REMOTE_ENCODE = True
Expand All @@ -23,6 +25,24 @@
}
}

# Override DATABASES when CI provides DATABASE_HOST (MariaDB)
if os.environ.get("DATABASE_HOST"):
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": os.environ.get("DATABASE_NAME", "pod"),
"USER": os.environ.get("DATABASE_USER", "root"),
"PASSWORD": os.environ.get("DATABASE_PASSWORD", ""),
"HOST": os.environ.get("DATABASE_HOST", "127.0.0.1"),
"PORT": os.environ.get("DATABASE_PORT", "3306"),
# option to avoid timezone warnings and ensure strict mode
"OPTIONS": {
"init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
"charset": "utf8mb4",
},
}
}

USE_CUT = True
USE_PODFILE = True
USE_NOTIFICATIONS = False
Expand Down
18 changes: 18 additions & 0 deletions pod/main/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,24 @@
}
}

# Override DATABASES when CI provides DATABASE_HOST (MariaDB)
if os.environ.get("DATABASE_HOST"):
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": os.environ.get("DATABASE_NAME", "pod"),
"USER": os.environ.get("DATABASE_USER", "root"),
"PASSWORD": os.environ.get("DATABASE_PASSWORD", ""),
"HOST": os.environ.get("DATABASE_HOST", "127.0.0.1"),
"PORT": os.environ.get("DATABASE_PORT", "3306"),
# option to avoid timezone warnings and ensure strict mode
"OPTIONS": {
"init_command": "SET sql_mode='STRICT_TRANS_TABLES'",
"charset": "utf8mb4",
},
}
}

LANGUAGES = (("fr", "Français"), ("en", "English"))
LANGUAGE_CODE = "en"
THIRD_PARTY_APPS = ["enrichment", "live"]
Expand Down
Loading