Skip to content

Add Django support

Add Django support #37

Workflow file for this run

name: Tests
on:
push:
branches:
- main
paths-ignore:
- "**/README.md"
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local
key: poetry-0 # increment to reset cache
- name: Install and configure Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: "1.5.1"
virtualenvs-in-project: true
- uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: poetry
- name: Run Poetry check
run: poetry check
- name: Install dependencies
run: poetry install --no-interaction --all-extras
- name: Run checks
run: poetry run make check
- name: Run tests and create coverage report
run: poetry run make test-coverage
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
test-matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
deps:
- starlette
- fastapi starlette
- fastapi==0.100.1 starlette
- fastapi==0.87.0 starlette
- flask
- flask==2.3.*
- flask==2.0.3
- djangorestframework django
- djangorestframework django==4.2.*
- djangorestframework==3.12.* django==3.2.*
- django-ninja django
- django-ninja==0.22.* django
- django-ninja==0.18.0 django
steps:
- uses: actions/checkout@v3
- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-0 # increment to reset cache
- name: Install and configure Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1
with:
version: "1.5.1"
virtualenvs-in-project: true
- name: Build Python package wheel
run: poetry build -f wheel
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python }}"
- name: Install test dependencies
run: poetry install --no-interaction --no-root --only test
- name: Install app dependencies
run: poetry run pip install ${{ matrix.deps }} ./dist/apitally-*.whl
- name: Run tests
run: poetry run make test