diora-web/.forgejo/workflows/test.yml
mrwnslz 5f7d4066c7
All checks were successful
Build and push Docker image / build (push) Successful in 15s
Test / test (push) Successful in 4m41s
CI: data/ anlegen, bevor manage.py check läuft
Seit die Podcast-Modelle JSON-Felder haben, öffnet die Systemprüfung die
Datenbank (unterstützt SQLite JSON?). Im CI fehlt data/ – die Prüfung
brach mit „unable to open database file“ ab, die Tests liefen gar
nicht. In Produktion ist data/ ein Volume, dort war nichts betroffen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 10:11:38 +02:00

40 lines
1.3 KiB
YAML

name: Test
on:
push:
branches:
- master
- testing
pull_request:
jobs:
test:
runs-on: ubuntu-latest
container:
# 22.04 ships Python 3.10, which cannot install the pinned Django (it
# needs >= 3.12). While requirements.txt still said "django>=4.2" that
# went unnoticed and pip quietly resolved a 4.x here — so CI was testing
# a different Django than the image actually shipped. 24.04 gives us
# 3.12, matching the Dockerfile's python:3.12-slim.
image: catthehacker/ubuntu:act-24.04
steps:
- uses: actions/checkout@v4
- name: Install Python dependencies
# 24.04 marks its system Python as externally managed (PEP 668), so a
# bare `pip install` is refused. A venv is the sanctioned way in.
run: |
python -m venv /tmp/venv
/tmp/venv/bin/pip install --no-cache-dir -r requirements.txt
- name: Django system check
# The SQLite file lives in data/ (a volume in production, git-ignored).
# Since the podcast models have JSON fields, the check opens the
# database to ask whether it supports them — so the folder must exist.
run: |
mkdir -p data
/tmp/venv/bin/python manage.py check
- name: Run tests
run: /tmp/venv/bin/python manage.py test