mirror of
https://github.com/snowy-yang/xiaonuan.git
synced 2026-10-21 08:04:48 +00:00
CI:Gitea Actions 测试工作流(PG 服务容器跑满全部测试)
This commit is contained in:
1 parent
6981c6df4d
commit
d50e6ee20c
1 file changed
+42
@@ -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
|
||||||
Reference in new issue
Block a user