Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
124 lines (106 loc) · 4.9 KB
/
Copy pathTaskfile.yml
File metadata and controls
124 lines (106 loc) · 4.9 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
version: '3'
# Every module of the repository (SPEC §3). go.work ties them together for
# local development; it is never committed.
vars:
MODULES: . claude codex codex/state gemini pi builtin examples
PLATFORMS: linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 windows/arm64
tasks:
build:
desc: Build every module
cmds:
- for m in {{.MODULES}}; do (cd $m && go build -o /dev/null ./...) || exit 1; done
test:quick:
desc: Run the unit tests of every module (no race detector, cached)
cmds:
- for m in {{.MODULES}}; do (cd $m && go test ./...) || exit 1; done
vet:
desc: Run go vet on every module
cmds:
- for m in {{.MODULES}}; do (cd $m && go vet ./...) || exit 1; done
example:
desc: Run examples/agentinfo against this machine (disk reads only; pass flags after --)
dir: examples
cmds:
- go run ./agentinfo -dir "{{.USER_WORKING_DIR}}" {{.CLI_ARGS}}
drift:
desc: Drift check against this machine's real Claude/Codex homes (disk reads only; no vendor binary, no network). Flags after --, e.g. -- -fixtures (repo fixture homes, same output everywhere), -- -claude-help help.txt -baseline last.tsv
dir: examples
cmds:
- go run ./drift {{.CLI_ARGS}}
example:darwin:
desc: Cross-compile examples/agentinfo to dist/agentinfo-darwin-arm64
cmds:
- mkdir -p dist
- cd examples && CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -o ../dist/agentinfo-darwin-arm64 ./agentinfo
docs:check:
desc: Check public markdown - snippet sync, relative links and anchors, no hard wraps, no local paths, no attribution (internal/docscheck) - then docsync (ds check, fails when code a doc sentence cites changed since it was acked); needs the ds CLI (go install github.com/ubgo/docsync/cli/cmd/ds@latest)
cmds:
- go test -count=1 ./internal/docscheck/
- 'command -v ds >/dev/null || { echo "docs:check needs the ds CLI: go install github.com/ubgo/docsync/cli/cmd/ds@latest"; exit 1; }'
- ds check
docs:snippets:
desc: Rewrite markdown snippet blocks from their Go source regions
cmds:
- go test -count=1 ./internal/docscheck/ -run '^TestSnippets$' -args -update
lint:
desc: Run golangci-lint (.golangci.yml) on every module; fails when it is not installed
cmds:
- for m in {{.MODULES}}; do (cd $m && golangci-lint run ./...) || exit 1; done
check:
desc: Full gate - gofmt, vet, staticcheck (if installed), golangci-lint, race tests, cross-compile 6 platforms, standalone (GOWORK=off) builds, docs (docscheck + docsync)
cmds:
- task: check:fmt
- task: vet
- task: check:staticcheck
- task: lint
- task: check:race
- task: check:windows
- task: check:cross
- task: check:standalone
- task: docs:check
check:fmt:
desc: Fail when any Go file is not gofmt-clean
cmds:
- |
out=$(gofmt -l $(git ls-files -co --exclude-standard '*.go'))
if [ -n "$out" ]; then echo "gofmt needed:"; echo "$out"; exit 1; fi
check:staticcheck:
desc: Run staticcheck on every module when it is installed
cmds:
- |
if ! command -v staticcheck >/dev/null; then echo "staticcheck not installed, skipped"; exit 0; fi
for m in {{.MODULES}}; do (cd $m && staticcheck ./...) || exit 1; done
check:race:
desc: Run every module's tests with the race detector
cmds:
- for m in {{.MODULES}}; do (cd $m && go test -race -count=1 ./...) || exit 1; done
check:windows:
desc: Vet every module for Windows and compile every test binary for Windows (GOOS=windows go vet, go test -c); the tests themselves run on Windows in the manual platforms workflow
cmds:
- |
out=$(mktemp -d)
trap 'rm -rf "$out"' EXIT
for m in {{.MODULES}}; do
(cd $m && GOOS=windows GOARCH=amd64 go vet ./... && GOOS=windows GOARCH=amd64 go test -c -o "$out/" ./... >/dev/null) || { echo "FAIL $m windows"; exit 1; }
echo "ok $m windows"
done
test:distros:
desc: Manual, slow (needs Docker and network) - run every module's tests plus agentinfo -fixtures and agentinfo on an empty and a seeded home in Debian, Alpine (musl), Fedora and Arch containers; not part of check
cmds:
- bash scripts/test-distros.sh
check:cross:
desc: Cross-compile every module for the 6 release platforms with CGO off
cmds:
- |
for p in {{.PLATFORMS}}; do
for m in {{.MODULES}}; do
(cd $m && CGO_ENABLED=0 GOOS=${p%/*} GOARCH=${p#*/} go build -o /dev/null ./...) || { echo "FAIL $m $p"; exit 1; }
done
echo "ok $p"
done
check:standalone:
desc: Build and vet every module outside go.work (GOWORK=off), using the pseudo-versions in each go.mod
env:
GOWORK: 'off'
cmds:
- for m in {{.MODULES}}; do (cd $m && go build -o /dev/null ./... && go vet ./...) || { echo "FAIL $m"; exit 1; }; echo "ok $m"; done