From f335329b43e5b545a8be52b094d6d3b1997b0a58 Mon Sep 17 00:00:00 2001 From: XiaoXia Bot Date: Thu, 16 Jul 2026 10:11:51 +0800 Subject: [PATCH] =?UTF-8?q?chore(ci):=20=E6=B7=BB=E5=8A=A0PostgreSQL?= =?UTF-8?q?=E8=AF=8A=E6=96=AD=E6=AD=A5=E9=AA=A4=20-=20=E6=8E=92=E6=9F=A5Al?= =?UTF-8?q?embic=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci-cd.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index df8f9a753..20e687565 100755 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -83,6 +83,20 @@ jobs: fi echo "🔧 包含后端/公共变更,继续完整检查" + - name: Runner PG诊断 + shell: sh + run: | + set +e + echo "=== PG诊断 ===" + echo "DATABASE_URL=$DATABASE_URL" + echo "--- PG进程 ---" + ps aux | grep postgres | grep -v grep + echo "--- 5432端口 ---" + ss -tlnp 2>/dev/null | grep 5432 || netstat -tlnp 2>/dev/null | grep 5432 || echo "port 5432: no listen" + echo "--- 连接测试 ---" + python3 -c "import os,sys;from sqlalchemy import create_engine,text;e=create_engine(os.environ['DATABASE_URL'],connect_args={'connect_timeout':5});c=e.connect();r=c.execute(text('SELECT version()'));print('PG:',r.fetchone()[0][:60]);r=c.execute(text("SELECT count(*) FROM information_schema.tables WHERE table_schema='public'"));print('tables:',r.fetchone()[0]);c.close();print('OK')" 2>&1 + echo "=== 诊断结束 ===" + - name: Detect frontend-only change shell: bash env: