mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-16 12:27:03 +08:00
ci: Run django test after our test (#612)
This commit is contained in:
1
.github/workflows/codeql.yml
vendored
1
.github/workflows/codeql.yml
vendored
@ -4,7 +4,6 @@ on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
schedule:
|
||||
- cron: "29 15 * * 6"
|
||||
|
||||
|
53
.github/workflows/django.yaml
vendored
53
.github/workflows/django.yaml
vendored
@ -1,53 +0,0 @@
|
||||
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;"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
# 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
|
||||
run: |
|
||||
#pip install -r requirements.txt
|
||||
#pip install mysqlclient # Use stable version
|
||||
pip install .
|
||||
|
||||
- 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/
|
||||
PYTHONPATH=.. python3 ./runtests.py --settings=test_mysql
|
5
.github/workflows/lint.yaml
vendored
5
.github/workflows/lint.yaml
vendored
@ -1,6 +1,9 @@
|
||||
name: Lint
|
||||
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
|
65
.github/workflows/tests.yaml
vendored
65
.github/workflows/tests.yaml
vendored
@ -6,8 +6,11 @@ on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
PIP_NO_PYTHON_VERSION_WARNING: 1
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11"]
|
||||
@ -38,14 +41,16 @@ jobs:
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: "pip"
|
||||
cache-dependency-path: "requirements.txt"
|
||||
|
||||
- name: Install dependencies
|
||||
env:
|
||||
PIP_NO_PYTHON_VERSION_WARNING: 1
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: 1
|
||||
- name: Install mysqlclient
|
||||
run: |
|
||||
pip install -v .
|
||||
|
||||
- name: Install test dependencies
|
||||
run: |
|
||||
pip install -r requirements.txt
|
||||
pip install .
|
||||
|
||||
- name: Run tests
|
||||
env:
|
||||
@ -54,3 +59,51 @@ jobs:
|
||||
pytest --cov=MySQLdb tests
|
||||
|
||||
- uses: codecov/codecov-action@v3
|
||||
|
||||
django-test:
|
||||
name: "Run Django LTS test suite"
|
||||
needs: test
|
||||
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;"
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
# 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
|
||||
run: |
|
||||
#pip install -r requirements.txt
|
||||
#pip install mysqlclient # Use stable version
|
||||
pip install .
|
||||
|
||||
- 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/
|
||||
PYTHONPATH=.. python3 ./runtests.py --settings=test_mysql
|
||||
|
9
.github/workflows/windows.yaml
vendored
9
.github/workflows/windows.yaml
vendored
@ -3,6 +3,7 @@ name: Build windows wheels
|
||||
on:
|
||||
push:
|
||||
branches: ["main", "ci"]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
@ -67,8 +68,14 @@ jobs:
|
||||
CIBW_TEST_COMMAND: "python -c \"import MySQLdb; print(MySQLdb.version_info)\" "
|
||||
run: "python -m cibuildwheel --prerelease-pythons --output-dir dist"
|
||||
|
||||
- name: Build sdist
|
||||
working-directory: mysqlclient
|
||||
run: |
|
||||
python -m pip install build
|
||||
python -m build -s -o dist
|
||||
|
||||
- name: Upload Wheel
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: win-wheels
|
||||
path: mysqlclient/dist/*.whl
|
||||
path: mysqlclient/dist/*.*
|
||||
|
6
setup.py
6
setup.py
@ -78,10 +78,6 @@ def get_config_posix(options=None):
|
||||
if static:
|
||||
ext_options["language"] = "c++"
|
||||
|
||||
print("Options for building extention module:")
|
||||
for k, v in ext_options.items():
|
||||
print(f" {k}: {v}")
|
||||
|
||||
return ext_options
|
||||
|
||||
|
||||
@ -157,7 +153,7 @@ if sys.platform == "win32":
|
||||
else:
|
||||
ext_options = get_config_posix(get_options())
|
||||
|
||||
print("# Extention options")
|
||||
print("# Options for building extention module:")
|
||||
for k, v in ext_options.items():
|
||||
print(f" {k}: {v}")
|
||||
|
||||
|
Reference in New Issue
Block a user