Skip to content

Commit 6885cb5

Browse files
committed
ci: test-build 新增 go test ./... job(补上后端测试缺口)
此前 CI 只有 docker build + go vet + golangci-lint,从不跑 go test ./...。 新增 test job 放在 docker 之前,失败即拦。已验证干净 checkout 可跑: validation 测试用内联 fixture(无需 models.js)、S3 集成带 integration build tag(无需 MinIO)。
1 parent 08a9408 commit 6885cb5

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

.github/workflows/test-build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,28 @@ env:
1010
IMAGE_NAME: ${{ github.repository }}
1111

1212
jobs:
13+
# ── Backend tests: go test ./... (fail fast, before Docker build) ──
14+
# 注意:go test ./... 已在干净 checkout 验证可行 ——
15+
# · validation 测试用内联 fixture,不依赖生成的 runtime/core-schema/models.js
16+
# · S3 集成测试带 `//go:build integration`,正常 go test 自动跳过(无需 MinIO)
17+
# · vault/pb_migrations 新增迁移冒烟 + JSVM 审计钩子测试(真 gate,失败即拦)
18+
test:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v7
22+
23+
- uses: actions/setup-go@v6
24+
with:
25+
go-version: stable
26+
cache-dependency-path: vault/go.sum
27+
28+
- name: go test ./...
29+
working-directory: vault
30+
env:
31+
GOPROXY: direct
32+
GONOSUMDB: "*"
33+
run: go test ./...
34+
1335
# ── Build Docker images (tagged with commit SHA) ──
1436
docker:
1537
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)