ci(server): 编译/测试直接在 runner 跑,去嵌套 docker(修 DinD;go 工具链自动下载)

compile-backend/test.sh 原在 golang:1.25 容器里跑,job 容器内 $PWD 在宿主不存在
→ DinD 挂载失败。改直接跑;go.mod 要求 1.25.10,靠 Go 工具链经 goproxy.cn 自动拉取。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-06 14:40:09 +08:00
parent f6e565ffdc
commit 3efd67297e
2 changed files with 8 additions and 16 deletions
+4 -9
View File
@@ -21,15 +21,10 @@ TARGET="${1:-}"
case "$TARGET" in
server)
mkdir -p "$HOME/.cache/pangolin-ci/gomod" "$HOME/.cache/pangolin-ci/gobuild"
echo "==> test: go test ./... (golang:1.25 容器)"
docker run --rm \
-v "$PWD/server:/app" -w /app \
-v "$HOME/.cache/pangolin-ci/gomod:/go/pkg/mod" \
-v "$HOME/.cache/pangolin-ci/gobuild:/root/.cache/go-build" \
-e GOPROXY="$GOPROXY" \
golang:1.25 \
go test ./...
# 直接在 runner 跑(不嵌套 docker,避免 DinD 挂载失败)。go.mod 要求的
# go 1.25.x 若高于 runner 自带版本,Go 工具链会经 GOPROXY(_env.sh)自动下载。
echo "==> test: go test ./..."
( cd server && go test ./... )
;;
client)
mkdir -p "$HOME/.cache/pangolin-ci/pubcache"