Skip to content

Commit

Permalink
Action: Run Django tests (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
methane authored Oct 20, 2021
1 parent 267e784 commit 8b92077
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 67 deletions.
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

0 comments on commit 8b92077

Please sign in to comment.