Skip to content

Commit a561259

Browse files
committed
Test on MySQL
1 parent 869096a commit a561259

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,49 @@ jobs:
7979
env:
8080
DATABASE_URL: postgres://postgres:postgres@localhost/postgres
8181

82+
test-mysql:
83+
runs-on: ubuntu-latest
84+
services:
85+
mysql:
86+
image: mysql:8.4
87+
env:
88+
MYSQL_ROOT_PASSWORD: django
89+
MYSQL_DATABASE: django
90+
ports:
91+
- 3306:3306
92+
strategy:
93+
fail-fast: false
94+
matrix:
95+
django-version: ["4.2", "5.0"]
96+
steps:
97+
- uses: actions/checkout@v3
98+
- name: Set up Python 3.11
99+
uses: actions/setup-python@v4
100+
with:
101+
python-version: 3.11
102+
- uses: actions/cache@v3
103+
with:
104+
path: ~/.cache/pip
105+
key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
106+
- uses: taiki-e/install-action@just
107+
- name: Install dependencies
108+
run: |
109+
pip install --upgrade pip
110+
pip install -e '.[dev]'
111+
pip install Django~=${{ matrix.django-version }}
112+
- name: Run tests
113+
run: just test
114+
env:
115+
DATABASE_URL: mysql://root:[email protected]/django
116+
82117
build:
83118
permissions:
84119
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
85120
runs-on: ubuntu-latest
86121
needs:
87122
- test
88-
- test-postgres:
123+
- test-postgres
124+
- test-mysql
89125
steps:
90126
- uses: actions/checkout@v3
91127
with:

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ dev = [
5151
"coverage",
5252
"django-stubs[compatible-mypy]",
5353
"dj-database-url",
54-
"psycopg"
54+
"psycopg",
55+
"mysqlclient"
5556
]
5657

5758
[tool.ruff.lint]

0 commit comments

Comments
 (0)