ci: validate alembic migration chain

This commit is contained in:
Xiaoxia AI
2026-06-21 07:49:23 +08:00
parent ebae5f51b0
commit 2ed2308b9f
3 changed files with 23 additions and 9 deletions
+10 -3
View File
@@ -61,12 +61,19 @@ jobs:
- name: Run code quality checks
run: |
python -m compileall -q apps packages tests
python -m black --check apps packages tests
python -m isort --check-only apps packages tests
python -m compileall -q alembic apps packages tests
python -m black --check alembic apps packages tests
python -m isort --check-only alembic apps packages tests
python -m flake8 apps packages tests --count --statistics
bandit -r apps packages -q
- name: Validate Alembic migrations
run: |
DATABASE_URL=postgresql+psycopg://postgres:postgres@localhost:5432/xiaoxia_saas \
python -m alembic upgrade head --sql > /tmp/alembic-upgrade.sql
test -s /tmp/alembic-upgrade.sql
grep -q "Running upgrade" /tmp/alembic-upgrade.sql
- name: Run tests
run: |
python -m pytest tests -q