Skip to content

Commit

Permalink
Setup CI to run againt MySQL.
Browse files Browse the repository at this point in the history
  • Loading branch information
charettes committed Nov 25, 2024
1 parent 80d41a0 commit bbe0bf2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ jobs:
--health-interval 10s
--health-timeout 5s
--health-retries 5
mysql:
image: mysql:8.0
env:
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_DATABASE: syzygy
ports:
- 3306:3306
options: >-
--health-cmd "mysqladmin ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v2
Expand Down
19 changes: 19 additions & 0 deletions tests/settings/mysql.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os

from . import * # noqa

DB_HOST = os.environ.get("DB_HOST", "localhost")
DB_PORT = os.environ.get("DB_PORT", "3306")
DB_USER = os.environ.get("DB_USER", "mysql")
DB_PASSWORD = os.environ.get("DB_PASSWORD", "mysql")

DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"HOST": DB_HOST,
"PORT": DB_PORT,
"NAME": "syzygy",
"USER": DB_USER,
"PASSWORD": DB_PASSWORD,
}
}
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ envlist =
isort
mypy
pypi
py{38,39}-{3.2,4.2}-{sqlite,postgresql}
py310-{3.2,4.2,5.0,main}-{sqlite,postgresql}
py{311,312}-{4.2,5.0,main}-{sqlite,postgresql}
py{38,39}-{3.2,4.2}-{sqlite,postgresql,mysql}
py310-{3.2,4.2,5.0,main}-{sqlite,postgresql,mysql}
py{311,312}-{4.2,5.0,main}-{sqlite,postgresql,mysql}

[gh-actions]
python =
Expand All @@ -30,6 +30,7 @@ usedevelop = true
setenv =
DJANGO_SETTINGS_MODULE=tests.settings
postgresql: DJANGO_SETTINGS_MODULE=tests.settings.postgresql
mysql: DJANGO_SETTINGS_MODULE=tests.settings.mysql
passenv =
GITHUB_*
DB_*
Expand All @@ -43,6 +44,7 @@ deps =
5.0: Django>=5,<5.1
main: https://github.com/django/django/archive/main.tar.gz
postgresql: psycopg2-binary
mysql: mysqlclient
ignore_outcome =
main: true

Expand Down

0 comments on commit bbe0bf2

Please sign in to comment.