Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action: Run Django tests #519

Merged
merged 9 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
53 changes: 53 additions & 0 deletions .github/workflows/django.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Django compat test

on:
push:

jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Start MySQL
run: |
sudo systemctl start mysql.service
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot mysql
mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; GRANT ALL ON *.* TO scott;"

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-django-pip-1
restore-keys: |
${{ runner.os }}-pip-

- name: Set up Python
uses: actions/setup-python@v2
with:
# https://www.mail-archive.com/django-updates@googlegroups.com/msg209056.html
python-version: "3.8"

- uses: actions/checkout@v2
with:
fetch-depth: 2

- name: Install mysqlclient
env:
PIP_NO_PYTHON_VERSION_WARNING: 1
PIP_DISABLE_PIP_VERSION_CHECK: 1
run: |
pip install -U pytest pytest-cov tblib
pip install .
# pip install mysqlclient # Use stable version

- name: Run Django test
env:
DJANGO_VERSION: "2.2.24"
run: |
sudo apt-get install libmemcached-dev
wget https://github.com/django/django/archive/${DJANGO_VERSION}.tar.gz
tar xf ${DJANGO_VERSION}.tar.gz
cp ci/test_mysql.py django-${DJANGO_VERSION}/tests/
cd django-${DJANGO_VERSION}/tests/
pip install ..
pip install -r requirements/py3.txt
PYTHONPATH=.. python3 ./runtests.py --settings=test_mysql
63 changes: 0 additions & 63 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions ci/test_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "django_default",
"USER": "django",
"HOST": "127.0.0.1",
"PASSWORD": "secret",
"USER": "scott",
"PASSWORD": "tiger",
"TEST": {"CHARSET": "utf8mb4", "COLLATION": "utf8mb4_general_ci"},
},
"other": {
"ENGINE": "django.db.backends.mysql",
"NAME": "django_other",
"USER": "django",
"HOST": "127.0.0.1",
"PASSWORD": "secret",
"USER": "scott",
"PASSWORD": "tiger",
"TEST": {"CHARSET": "utf8mb4", "COLLATION": "utf8mb4_general_ci"},
},
}
Expand Down