Skip to content

remove duplicate database url for testing; #64

remove duplicate database url for testing;

remove duplicate database url for testing; #64

Workflow file for this run

name: test server
env:
# aligns neatly with pytest-pretty's output
COLUMNS: 120
on:
push:
branches:
- main
paths:
- server/**
pull_request:
branches:
- main
paths:
- server/**
jobs:
test-server:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: ./server
env:
SERVER_DEBUG: true
SERVER_ENVIRONMENT: "testing"
SERVER_LOG_LEVEL: "INFO"
SERVER_DATABASE_URL: "postgresql+asyncpg://user:pass@localhost:5432/todos"
SERVER_DATABASE_POOL_SIZE: 20
SERVER_CORS_ALLOW_ORIGINS: '["*"]'
SERVER_OPENAPI_URL:
services:
postgres:
image: "bitnami/postgresql:16"
ports:
- "5432:5432"
env:
POSTGRESQL_USERNAME: "user"
POSTGRESQL_PASSWORD: "pass"
POSTGRESQL_DATABASE: "todos_test"
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Cache Dependencies
uses: actions/cache@v3
with:
path: |
~/.cache/pip
.venv
key: ${{ runner.os }}-pip-${{ hashFiles('**/pdm.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install PDM
run: |
pip install pdm
pdm sync --clean
- name: Run Tests
run: pdm run test
- name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}