From d50e6ee20c5c27863fddca53ca6c506eff5f522c Mon Sep 17 00:00:00 2001 From: snowy-yang <102860110+snowy-yang@users.noreply.github.com> Date: Wed, 23 Sep 2026 21:09:43 +0800 Subject: [PATCH] =?UTF-8?q?CI=EF=BC=9AGitea=20Actions=20=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=88PG=20=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E8=B7=91=E6=BB=A1=E5=85=A8=E9=83=A8=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/test.yml | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitea/workflows/test.yml diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml new file mode 100644 index 0000000..df53e4d --- /dev/null +++ b/.gitea/workflows/test.yml @@ -0,0 +1,42 @@ +name: test + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +jobs: + pytest: + runs-on: ubuntu-latest + services: + postgres: + image: postgres:17-alpine + env: + POSTGRES_PASSWORD: ci + POSTGRES_DB: xiaonuan_ci + options: >- + --health-cmd "pg_isready -U postgres" + --health-interval 5s + --health-timeout 3s + --health-retries 10 + ports: + - 5432:5432 + env: + PG_DSN: postgresql://postgres:ci@postgres:5432/xiaonuan_ci + steps: + - name: 拉代码 + uses: actions/checkout@v4 + + - name: 装 Python 3.14 + uses: actions/setup-python@v5 + with: + python-version: "3.14" + + - name: 安装 uv 并同步依赖 + run: | + pip install uv + uv sync + + - name: 跑测试(含 PG 集成) + run: uv run pytest -q