Skip to content

Page X of Y OCR

Page X of Y OCR #298

Workflow file for this run

name: Unit Tests
on:
push:
branches: [main, staging]
pull_request:
workflow_dispatch:
jobs:
unit-tests:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: kindle_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install dependencies with uv
run: |
uv venv .venv
source .venv/bin/activate
uv pip install -r requirements.txt
- name: Run unit tests
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/kindle_test
run: |
make test-unit
timeout-minutes: 5
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: unit-test-results
path: |
.coverage
htmlcov/
retention-days: 7