Integrated swappable model support #128
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**.py' | |
- '**.txt' | |
- '**.yaml' | |
- '**.toml' | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '**.py' | |
- '**.txt' | |
- '**.toml' | |
- '**.yaml' | |
env: | |
GITHUB_WORKFLOW: true | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
# test matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- 3.8 | |
- 3.9 | |
django: | |
- 3.2 | |
- 4.0 | |
database: | |
- sqlite | |
- mysql | |
- postgres | |
# additional service containers to run | |
services: | |
# postgres service | |
postgres: | |
# docker hub image | |
image: postgres:13-alpine | |
# configure the instance | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
ports: | |
- 5432:5432 | |
# set health checks to wait until service has started | |
options: >- | |
--health-cmd="pg_isready" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
# mysql service | |
mysql: | |
# docker hub image | |
image: mysql:8 | |
# configure the instance | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: yes | |
MYSQL_DATABASE: test | |
ports: | |
- 3306:3306 | |
# set health checks to wait until service has started | |
options: >- | |
--health-cmd="mysqladmin ping" | |
--health-interval=10s | |
--health-timeout=5s | |
--health-retries=5 | |
steps: | |
# check out revision to test | |
- uses: actions/checkout@v4 | |
# install python | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# upgrade pip | |
- name: Update pip | |
run: python -m pip install --upgrade pip | |
# install environment specific dependencies | |
- name: Install coverage | |
run: pip install coverage>=5.3 | |
- name: Install Django 3.2 | |
if: matrix.django == 3.2 | |
run: pip install "Django>=3.2,<4.0" | |
- name: Install Django 4.0 | |
if: matrix.django == 4.0 | |
run: pip install "Django>=4.0,<4.1" | |
- name: Install MySQL libs | |
if: matrix.database == 'mysql' | |
run: pip install mysqlclient>=2.0.1 django-mysql>=3.9.0 | |
- name: Install postgres libs | |
if: matrix.database == 'postgres' | |
run: pip install psycopg2-binary>=2.8.6 | |
- name: Install Django ReST framework libraries | |
run: pip install -U django-rest-framework rest-framework-generic-relations drf-spectacular | |
# install our package | |
- name: Install package | |
run: pip install -e . | |
# execute the tests | |
- name: Run tests | |
run: coverage run runtests/manage.py test -v3 --noinput actstream testapp testapp_nested | |
env: | |
DATABASE_ENGINE: ${{ matrix.database }} | |
# COVERAGE_FILE: ".coverage.${{ matrix.python_version }}" | |
- name: Store coverage file | |
uses: actions/upload-artifact@v3 | |
with: | |
name: coverage | |
path: .coverage #.${{ matrix.python_version }} | |
- name: Coveralls | |
uses: AndreMiras/coveralls-python-action@develop | |
with: | |
parallel: true | |
flag-name: Unit Test | |
coveralls_finish: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Coveralls Finished | |
uses: AndreMiras/coveralls-python-action@develop | |
with: | |
parallel-finished: true |