mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-08-26 16:40:40 +03:00
49 lines
1.2 KiB
YAML
49 lines
1.2 KiB
YAML
|
|
name: Unit Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
services:
|
|
sqldb:
|
|
image: postgres:13
|
|
env:
|
|
POSTGRES_USER: user
|
|
POSTGRES_PASSWORD: secret
|
|
POSTGRES_DB: testdb
|
|
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
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Set up Python 3.10.1
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.10.2
|
|
- name: Install pipenv
|
|
run: pip install pipenv --upgrade
|
|
- name: Upgrde pip, setuptools and wheel
|
|
run: pip install --upgrade pip setuptools wheel
|
|
- name: Install required libs
|
|
run: pipenv install --system --sequential --ignore-pipfile --dev
|
|
- name: Run tests
|
|
run: pytest
|
|
env:
|
|
PYTHONDONTWRITEBYTECODE: 1
|
|
PYTHONUNBUFFERED: 1
|
|
SQL_DB: devdb
|
|
SQL_TEST_DB: testdb
|
|
SQL_HOST: 127.0.0.1
|
|
SQL_USER: user
|
|
POSTGRES_PASSWORD: secret
|