-
Notifications
You must be signed in to change notification settings - Fork 13
148 lines (123 loc) · 4.23 KB
/
Copy pathci.yml
File metadata and controls
148 lines (123 loc) · 4.23 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: CI
on:
pull_request:
branches: ["main"]
push:
branches: ["main"]
workflow_call:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
go-test:
name: Go Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: "Run Go tests (Phase 51 QUAL-07: -race -shuffle=on, tests/e2e 排除)"
run: |
set -euo pipefail
go test $(go list ./... | grep -v '/tests/e2e$') -race -shuffle=on -count=1
go test ./tests/e2e/... -count=1
web-build:
name: Web Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: web/admin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
package_json_file: web/admin/package.json
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: web/admin/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build web app
run: pnpm build
perf-benchmark:
name: Performance Benchmark (synthetic 10k, local baseline)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install hyperfine + ripgrep + jq
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends hyperfine ripgrep jq
- name: Generate synthetic tree
run: bash scripts/gen-bench-tree.sh --count=10000 --output=/tmp/bench-tree --seed=42
- name: Run benchmark (CI baseline only)
run: bash scripts/perf-benchmark.sh --ci-mode --runs=10 --warmup=1
- name: Upload bench artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: perf-bench-${{ github.sha }}
path: .planning/phases/35-e2e/benchmarks/
if-no-files-found: warn
retention-days: 30
image-size-regression:
name: Image Size Regression (BASE-04 ≤ 2GB)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read expected image name
id: read-image
run: |
IMAGE_NAME=$(awk -F': ' '$1 == "local_dev_image_name" { print $2 }' deploy/docker/managed-user/image.lock)
if [ -z "$IMAGE_NAME" ]; then
echo "failed to read local_dev_image_name from image.lock" >&2
exit 1
fi
echo "IMAGE_NAME=$IMAGE_NAME" >> "$GITHUB_OUTPUT"
- name: Build managed-user image
run: |
docker build \
-t "${{ steps.read-image.outputs.IMAGE_NAME }}" \
-f deploy/docker/managed-user/Dockerfile \
.
- name: Run verify-managed-image.sh
run: bash scripts/verify-managed-image.sh
- name: Assert uncompressed size ≤ 3GB
run: |
size=$(docker image inspect "${{ steps.read-image.outputs.IMAGE_NAME }}" --format='{{.Size}}')
max=$((2048 * 1024 * 1024)) # 2048 MiB = 2147483648 bytes
echo "image_size_bytes=$size (max=$max)"
if [ "$size" -gt "$max" ]; then
echo "FAIL: image size $size > $max (2GB)" >&2
exit 1
fi
echo "PASS: image size within BASE-04 budget"
lint-no-bare-sleep:
name: Lint — no bare sleep in tests/e2e
# Phase 45 Plan 05:守护 tests/e2e/ 套件不出现裸 time.Sleep。
# 与 .github/workflows/e2e.yml 的同名步骤双重守护:本 job 永远跑(不带
# paths 过滤),保证脚本本身不腐烂;e2e.yml 上的 lint 是 paths 过滤后的
# 强制守护。重复运行成本极低(脚本 < 1s)。
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: bash -n
run: bash -n scripts/lint-no-bare-sleep.sh
- name: Run lint-no-bare-sleep
run: bash scripts/lint-no-bare-sleep.sh