mirror of
https://github.com/snowy-yang/xiaonuan.git
synced 2026-10-21 08:04:48 +00:00
43 lines
898 B
YAML
43 lines
898 B
YAML
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
|