Merge pull request #17 from netzkolchose/compat4.2 #72
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
name: test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ['3.8', '3.11'] | |
django-version: ['3.2', '4.2'] | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_PASSWORD: mysecretpassword | |
ports: ['5432:5432'] | |
mariadb: | |
image: mariadb:latest | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: database | |
ports: ['3306:3306'] | |
mysql: | |
image: mysql:latest | |
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: 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: | | |
./test_all.sh | |
- name: Coveralls | |
uses: AndreMiras/coveralls-python-action@develop | |
with: | |
parallel: true | |
flag-name: Unit Test | |
psycopg3: | |
runs-on: ubuntu-latest | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: ['3.8', '3.11'] | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_PASSWORD: mysecretpassword | |
ports: ['5432:5432'] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r example/requirements-psycopg3.txt | |
- name: Run Tests | |
run: | | |
echo -e "\nTEST: postgres with psycopg3" | |
DBENGINE=postgres coverage run --parallel-mode --source='fast_update' ./example/manage.py test exampleapp || exit 1 | |
DBENGINE=postgres coverage run --parallel-mode --source='fast_update' ./example/manage.py test postgres_tests || 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, psycopg3] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: AndreMiras/coveralls-python-action@develop | |
with: | |
parallel-finished: true |