Skip to content

docs(paperclip-ops): reflect direct Sentry->Paperclip integration (#213) #280

docs(paperclip-ops): reflect direct Sentry->Paperclip integration (#213)

docs(paperclip-ops): reflect direct Sentry->Paperclip integration (#213) #280

Workflow file for this run

name: CI
on:
pull_request:
branches: [production]
types: [opened, reopened, synchronize, edited]
push:
branches: [production]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- run: pip install ruff==0.15.*
- run: ruff check src/ tests/
- run: ruff format --check src/ tests/
# Catch multi-head migrations BEFORE the slow test job. After a rebase,
# two migrations can both point at the same down_revision and produce
# a confusing UndefinedTableError downstream. This 1-second pure-text
# scan fails fast with a clear message instead.
- name: Verify single alembic head
run: |
python3 - <<'PY'
import re, sys, pathlib
rev_re = re.compile(r"^revision\s*=\s*['\"]([^'\"]+)['\"]", re.M)
down_re = re.compile(r"^down_revision\s*=\s*['\"]([^'\"]+)['\"]", re.M)
revs, parents = set(), set()
for f in pathlib.Path("alembic/versions").glob("*.py"):
text = f.read_text()
m = rev_re.search(text)
if m:
revs.add(m.group(1))
for p in down_re.findall(text):
parents.add(p)
heads = sorted(revs - parents)
if len(heads) != 1:
print(f"::error::Expected 1 alembic head, found {len(heads)}: {heads}")
print("Re-parent your migration's down_revision to the current tip.")
sys.exit(1)
print(f"Single alembic head: {heads[0]}")
PY
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:14
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:6.2
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.14"
- run: pip install -r requirements/dev.txt
- run: pytest tests/ -x -q
env:
DATABASE_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
REDIS_URL: redis://localhost:6379
TELEGRAM_BOT_TOKEN: "fake:token"
TELEGRAM_BOT_USERNAME: "test_bot"
TELEGRAM_BOT_WEBHOOK_SECRET: "test_secret"
MEME_STORAGE_TELEGRAM_CHAT_ID: "-1001234567890"
UPLOADED_MEMES_REVIEW_CHAT_ID: "-1001234567890"
ADMIN_LOGS_CHAT_ID: "-1001234567890"