Files
django-q2/.github/workflows/test.yml

67 lines
1.9 KiB
YAML

name: tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
django: [ "2.2", "3.2" ]
services:
disque:
image: efrecon/disque:1.0-rc1
ports:
- '7711:7711/tcp'
mongodb:
image: mongo
ports:
- 27017:27017
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
# needed because the postgres container does not provide a health check
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies with Django ${{ matrix.django }}
run: |
python -m pip install --upgrade pip
pip install poetry
poetry add "django==${{ matrix.django }}"
poetry install -E testing
- name: Run Tests
run: |
poetry run pytest --cov=./django_q --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v1
env:
PYTHON: ${{ matrix.python-version }}
DJANGO: ${{ matrix.django }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON, DJANGO
fail_ci_if_error: true
- name: Build docs
run: |
poetry run sphinx-build -b html -d docs/_build/doctrees -nW docs docs/_build/html