diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ef8eb18..77c6763 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 diff --git a/tests/settings/mysql.py b/tests/settings/mysql.py new file mode 100644 index 0000000..78abdb1 --- /dev/null +++ b/tests/settings/mysql.py @@ -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, + } +} diff --git a/tox.ini b/tox.ini index b1b9d98..a689f2e 100644 --- a/tox.ini +++ b/tox.ini @@ -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 = @@ -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_* @@ -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