3c32becba6
Co-Authored-By: Claude Code <noreply@anthropic.com>
44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
# CI(备用):自建 git 服务可能不跑 GitHub Actions——本文件保留备用,
|
|
# 本地质量门以 pnpm 脚本为准:pnpm lint && pnpm typecheck && pnpm db:test。
|
|
# 与本地等价性:PG 由 services 容器提供(同 infra/docker-compose.yml 凭据/端口),
|
|
# vitest globalSetup 自建临时库 sf_test_<ts>,无需预迁移开发库。
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
jobs:
|
|
verify:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
postgres:
|
|
image: postgres:16
|
|
env:
|
|
POSTGRES_USER: siteforge
|
|
POSTGRES_PASSWORD: siteforge_dev
|
|
POSTGRES_DB: siteforge
|
|
ports:
|
|
- 5434:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U siteforge"
|
|
--health-interval 5s
|
|
--health-timeout 3s
|
|
--health-retries 10
|
|
env:
|
|
DATABASE_URL: postgres://siteforge:siteforge_dev@localhost:5434/siteforge
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.7.1
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm lint
|
|
- run: pnpm typecheck
|
|
- run: pnpm test
|