Skip to content

Add flake8

Add flake8 #6

Workflow file for this run

name: CI
on:
pull_request:
push:
branches: ["develop", "main"]
jobs:
lint-and-test:
runs-on: ubuntu-latest
services:
db:
image: postgres:16
env:
POSTGRES_DB: theater_test
POSTGRES_USER: theater
POSTGRES_PASSWORD: theater
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U theater -d theater_test"
--health-interval 10s
--health-timeout 5s
--health-retries 10
mailhog:
image: mailhog/mailhog:latest
ports:
- 1025:1025
- 8025:8025
env:
ENVIRONMENT: testing
PYTHONPATH: ${{ github.workspace }}/src
# DB for tests
DATABASE_URL: postgresql+asyncpg://theater:theater@localhost:5432/theater_test
# Email (MailHog)
EMAIL_HOST: localhost
EMAIL_PORT: "1025"
EMAIL_HOST_USER: testuser@mate.com
EMAIL_HOST_PASSWORD: test_password
EMAIL_USE_TLS: "False"
# If your tests need MinIO, add it as a service (or mock it)
# MINIO_HOST: localhost
# MINIO_PORT: "9000"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install Poetry
run: pip install poetry
- name: Configure Poetry
run: poetry config virtualenvs.create false
- name: Install dependencies (incl dev tools)
run: poetry install --no-root --with dev
- name: Lint (flake8)
run: flake8 src
- name: Run tests (pytest)
run: pytest -q