mirror of
https://gitcode.com/JianFeeeee/homeagent-sdk.git
synced 2026-09-30 06:13:14 +00:00
首次跑出来的 8 个失败全是本 workflow 自己的问题,不是代码缺陷。
三条都属同一类:**命令本地验证过,但环境前提不同**。
## 1. hmapdev 交叉编译:在错误的目录跑(5 个平台全红)
no Go files in /home/runner/work/homeagentsdk/homeagentsdk
`go build .` 缺 `working-directory: tools/hmapdev`,于是在仓库根执行 ——
根目录没有 Go 文件(包在 sdk/ 子目录)。加 working-directory 后本地实测
linux/arm64、darwin/arm64、windows/amd64 均产出 27–30MB 二进制。
## 2. Examples:装了 Go 1.21,而 examples 要求 1.25
go: go.mod requires go >= 1.25.0 (running go 1.21.0; GOTOOLCHAIN=local)
`go-version-file: go.mod` 读的是**根** go.mod —— 它写 `go 1.21.0`,
而 20 个 `example/*/go.mod` 都要求 `go 1.25.0`(只有根与 tools/hmapdev 是 1.21)。
于是 CI 装 1.21,examples 构建必失败。
★ 为什么本地测不出来:本机 Go 1.27 且 GOTOOLCHAIN 默认可自动取更高工具链,
更高版本能满足 1.25 的下限,所以一路通过。而 GitHub runner 上
**GOTOOLCHAIN=local**,Go 拒绝自动下载工具链,低版本直接报错。
本地「能过」在这里完全不构成证据。
改法:SDK CI 全部钉 `go-version: '1.25'`(同时满足 1.21 的下限与
examples 的 1.25 要求)。
## 3. 技能检查:hmapdev 建到了 /tmp
error: no active SDK version set
`resolveSkillsSource()` 先用**可执行文件位置**向上找仓库
(tools/hmapdev → ../../skills),落空才回退到 SDK store 的活跃版本。
我把二进制建到 /tmp/hmapdev ⇒ 推出仓库失败 ⇒ 回退 ⇒ CI 里没有 store ⇒ 报错。
改法:建到仓库内 `<repo>/build/hmapdev_ci`。本地实测(构建在仓库内时,
即便从 /tmp 调用也能正确识别仓库源——解析依据是 exe 位置而非 cwd)。
## 附带记录
- 根 go.mod(1.21) 与 example/*/go.mod(1.25) 的版本不一致本身值得关注:
用 Go 1.22–1.24 的用户按示例走会失败。是否统一属产品决策,本次不动。
- actionlint 全绿。