-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Update Django test workflow (#610)
- Loading branch information
Showing
4 changed files
with
33 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,22 @@ name: Django compat test | |
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
name: "Run Django LTS test suite" | ||
runs-on: ubuntu-latest | ||
env: | ||
PIP_NO_PYTHON_VERSION_WARNING: 1 | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
DJANGO_VERSION: "3.2.19" | ||
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 "set global innodb_flush_log_at_trx_commit=0;" | ||
mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; GRANT ALL ON *.* TO scott;" | ||
mysql -uroot -proot -e "CREATE DATABASE django_default; CREATE DATABASE django_other;" | ||
|
@@ -19,27 +26,28 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
# https://www.mail-archive.com/[email protected]/msg209056.html | ||
python-version: "3.11" | ||
# Django 3.2.9+ supports Python 3.10 | ||
# https://docs.djangoproject.com/ja/3.2/releases/3.2/ | ||
python-version: "3.10" | ||
cache: "pip" | ||
cache-dependency-path: "ci/django-requirements.txt" | ||
|
||
- name: Install mysqlclient | ||
env: | ||
PIP_NO_PYTHON_VERSION_WARNING: 1 | ||
PIP_DISABLE_PIP_VERSION_CHECK: 1 | ||
run: | | ||
pip install -r requirements.txt | ||
#pip install -r requirements.txt | ||
#pip install mysqlclient # Use stable version | ||
pip install . | ||
# pip install mysqlclient # Use stable version | ||
- name: Run Django test | ||
env: | ||
DJANGO_VERSION: "3.2.19" | ||
- name: Setup Django | ||
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} | ||
pip install . -r tests/requirements/py3.txt | ||
- name: Run Django test | ||
run: | | ||
cd django-${DJANGO_VERSION}/tests/ | ||
pip install .. | ||
pip install -r requirements/py3.txt | ||
PYTHONPATH=.. python3 ./runtests.py --settings=test_mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,5 @@ clean: | |
|
||
.PHONY: check | ||
check: | ||
ruff . | ||
black *.py src | ||
ruff *.py src ci | ||
black *.py src ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters