sdk-ci / test (push) Failing after 48s
CGO free 红线由交叉编译步骤的局部 CGO_ENABLED=0 保证;测试二进制开 cgo 运行 race 检测不属交付物。
34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
# 益铸 EntitleForge SDK CI(Gitea Actions;零第三方依赖库,流水线同样零 action 依赖)
|
||
name: sdk-ci
|
||
|
||
on:
|
||
push:
|
||
branches: ["*"]
|
||
tags: ["v*"]
|
||
pull_request:
|
||
|
||
jobs:
|
||
test:
|
||
runs-on: ubuntu-latest
|
||
steps:
|
||
- uses: actions/checkout@v4
|
||
- uses: actions/setup-go@v5
|
||
with:
|
||
go-version: "1.27"
|
||
mirror: https://mirrors.aliyun.com/golang/
|
||
- name: 全量测试(race + shuffle)
|
||
run: go test -race -shuffle=on ./...
|
||
- name: 依赖闭包断言(零第三方依赖红线)
|
||
run: |
|
||
DEPS=$(go list -deps ./... | grep -vE "^(internal|vendor)/" | grep "\." | \
|
||
grep -v "^git.wxccs.org/EntitleForge/EntitleForge-SDK-go" || true)
|
||
if [ -n "$DEPS" ]; then
|
||
echo "SDK 引入了第三方依赖(违反零依赖红线):"; echo "$DEPS"; exit 1
|
||
fi
|
||
echo "依赖闭包:纯标准库 ✓"
|
||
- name: 交叉编译冒烟(CGO free)
|
||
run: |
|
||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ./...
|
||
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build ./...
|
||
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build ./...
|