* Bump supported fastapi version to <=0.97, change all fastapi tests from starlette client to httpx.AsyncClient * Add lifecycle manager to fastapi tests * Fix coverage * Add python 3.11 to test suite, bump version
76 lines
2.3 KiB
YAML
76 lines
2.3 KiB
YAML
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
|
|
|
name: build
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- 'gh-pages'
|
|
pull_request:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
tests:
|
|
name: "Python ${{ matrix.python-version }}"
|
|
runs-on: ubuntu-latest
|
|
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'collerek/ormar'
|
|
strategy:
|
|
matrix:
|
|
python-version: [3.7, 3.8, 3.9, "3.10", 3.11]
|
|
fail-fast: false
|
|
services:
|
|
mysql:
|
|
image: mysql:5.7
|
|
env:
|
|
MYSQL_USER: username
|
|
MYSQL_PASSWORD: password
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: testsuite
|
|
ports:
|
|
- 3306:3306
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
|
|
postgres:
|
|
image: postgres:10.8
|
|
env:
|
|
POSTGRES_USER: username
|
|
POSTGRES_PASSWORD: password
|
|
POSTGRES_DB: testsuite
|
|
ports:
|
|
- 5432:5432
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install poetry==1.4.2
|
|
poetry install --extras "all"
|
|
env:
|
|
POETRY_VIRTUALENVS_CREATE: false
|
|
- name: Run mysql
|
|
env:
|
|
DATABASE_URL: "mysql://username:password@127.0.0.1:3306/testsuite"
|
|
run: bash scripts/test.sh
|
|
- name: Run postgres
|
|
env:
|
|
DATABASE_URL: "postgresql://username:password@localhost:5432/testsuite"
|
|
run: bash scripts/test.sh
|
|
- name: Run sqlite
|
|
env:
|
|
DATABASE_URL: "sqlite:///testsuite"
|
|
run: bash scripts/test.sh
|
|
- run: mypy ormar tests benchmarks
|
|
- name: Upload coverage
|
|
uses: codecov/codecov-action@v3.1.4
|
|
- name: Test & publish code coverage
|
|
uses: paambaati/codeclimate-action@v4.0.0
|
|
if: github.event.pull_request.head.repo.full_name == 'collerek/ormar'
|
|
env:
|
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_COVERAGE_TOKEN }}
|