Skip to content

Commit

Permalink
Merge f5f2ef8 into 7d727ad
Browse files Browse the repository at this point in the history
  • Loading branch information
jerch committed Apr 29, 2022
2 parents 7d727ad + f5f2ef8 commit 0596986
Show file tree
Hide file tree
Showing 3 changed files with 236 additions and 110 deletions.
55 changes: 53 additions & 2 deletions .github/workflows/django.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
run: |
ldd $(python -c 'import _sqlite3;print(_sqlite3.__file__)')
sudo cp /usr/local/lib/libsqlite3.so.0 /lib/x86_64-linux-gnu/libsqlite3.so.0
python -c 'import sqlite3;print("SQLITE VERSION", sqlite3.sqlite_version_info)'
python -c 'import sqlite3,sys;print("SQLITE VERSION", sqlite3.sqlite_version_info);sys.exit(1 if sqlite3.sqlite_version_info < (3, 33) else 0)'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -66,8 +66,59 @@ jobs:
parallel: true
flag-name: Unit Test

test_old:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: ['3.8']
django-version: ['3.2']
services:
mariadb:
image: mariadb:10.2
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: database
ports: ['3306:3306']
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: database
ports: ['6603:3306']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Check for old SQLITE version
run: |
python -c 'import sqlite3,sys;print("SQLITE VERSION", sqlite3.sqlite_version_info);sys.exit(1 if sqlite3.sqlite_version_info >= (3, 33) else 0)'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install "Django~=${{ matrix.django-version }}"
pip install -r example/requirements.txt
- name: Run Tests
run: |
echo -e "\nTEST: sqlite <3.33"
DBENGINE=sqlite coverage run --parallel-mode --source='fast_update' ./example/manage.py test exampleapp || exit 1
echo -e "\nTEST: mariadb 10.2"
DBENGINE=mysql coverage run --parallel-mode --source='fast_update' ./example/manage.py test exampleapp || exit 1
echo -e "\nTEST: mysql 5.7"
DBENGINE=mysql8 coverage run --parallel-mode --source='fast_update' ./example/manage.py test exampleapp || exit 1
coverage combine
coverage report
coverage html
- name: Coveralls
uses: AndreMiras/coveralls-python-action@develop
with:
parallel: true
flag-name: Unit Test

coveralls_finish:
needs: [test]
needs: [test, test_old]
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
Expand Down
1 change: 1 addition & 0 deletions example/example/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@
}
elif DBENGINE == 'mysql8':
# docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=database -p 6603:3306 -d mysql
# mysql:5.7.38 for mysql_old
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
Expand Down
Loading

0 comments on commit 0596986

Please sign in to comment.