-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (77 loc) · 2.38 KB
/
Copy pathci.yml
File metadata and controls
94 lines (77 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: CI
on:
pull_request:
branches: [master]
workflow_dispatch:
jobs:
backend:
name: Go build / test / vet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
# SQLite 驱动为纯 Go(glebarez),无 CGO 依赖,可直接跑
- name: Build
run: go build ./...
- name: Vet
run: go vet ./...
- name: Test
run: go test ./... -count=1
frontend:
name: Web build
runs-on: ubuntu-latest
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 11
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: web/pnpm-lock.yaml
- name: Install
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm build
- name: Test anchors stripped from dist
run: |
hits=$(grep -rl 'data-test-id' dist/ | wc -l)
if [ "$hits" != "0" ]; then
echo "data-test-id leaked into production build:"; grep -rl 'data-test-id' dist/
exit 1
fi
# 锚点铺设曾把自闭合标签写成 ` / :data-test-id=`(剥离插件在 build 期会删掉
# 该属性故 dist 门禁测不出,dev 模板编译直接 Illegal '/' 整页空白)——静态扫描兜底
- name: Guard malformed data-test-id anchors
run: |
if grep -rnE ' / ?\:?data-test-id=' web/src --include='*.vue'; then
echo "found malformed self-closing tag before data-test-id (see above)"
exit 1
fi
integration:
name: Integration tests (API)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.25"
cache: true
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
working-directory: tests
- name: Sync Python deps
working-directory: tests
run: uv sync --frozen
# 后端自包含:临时实例(随机端口 + 独立 SQLite + 全量迁移)由 conftest 编排
- name: Run API integration tests
working-directory: tests
run: uv run pytest api -q