Skip to content

Fix compatibility with aiosqlite 0.20 #665

Fix compatibility with aiosqlite 0.20

Fix compatibility with aiosqlite 0.20 #665

Workflow file for this run

name: Build
on:
push:
branches: [main]
tags: ['v*']
pull_request:
branches: [main]
workflow_dispatch:
env:
LATEST_PY_VERSION: '3.12'
COVERAGE_ARGS: '--cov --cov-report=term --cov-report=xml'
XDIST_ARGS: '--numprocesses=auto --dist=loadfile'
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.12'
- '3.11'
- '3.10'
- '3.9'
- '3.8'
services:
nginx:
image: kennethreitz/httpbin
ports:
- 8080:80
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: snok/install-poetry@v1.3
with:
virtualenvs-in-project: true
version: 1.7.1
# Start integration test databases
- uses: supercharge/mongodb-github-action@1.3.0
with:
mongodb-version: 4.4
- uses: supercharge/redis-github-action@1.4.0
with:
redis-version: '6'
- uses: rrainn/dynamodb-action@v3.0.0
# Cache packages per python version, and reuse until lockfile changes
- name: Cache python packages
id: cache
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: poetry install -v -E all
- name: Run custom test server
run: |
source $VENV
cd test && gunicorn -D -c server/gunicorn-cfg.py server:app
# Run tests with coverage report
- name: Run tests
run: |
source $VENV
pytest -rs test/unit ${{ env.XDIST_ARGS }} ${{ env.COVERAGE_ARGS }}
pytest -rs test/integration --cov-append ${{ env.XDIST_ARGS }} ${{ env.COVERAGE_ARGS }}
# Latest python version: send coverage report to codecov
- name: 'Upload coverage report to Codecov'
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
uses: codecov/codecov-action@v3
# Run code analysis checks
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.LATEST_PY_VERSION }}
- name: Run style checks and linting via pre-commit hooks
uses: pre-commit/action@v3.0.0