-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
68 lines (57 loc) · 1.78 KB
/
Copy pathTaskfile.yml
File metadata and controls
68 lines (57 loc) · 1.78 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
# Development tasks. `task check` is the gate: everything a commit must
# pass, composed from the atomic tasks below in the order that fails
# fastest. Tools run through `go run` at pinned versions, so the gate is
# reproducible on any machine with a Go toolchain and nothing else.
version: "3"
vars:
GOLANGCI: go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.13.0
GOVULNCHECK: go run golang.org/x/vuln/cmd/govulncheck@latest
tasks:
default:
deps: [check]
check:
desc: "Full gate: formatting, tidy, lint, race tests, govulncheck"
cmds:
- task: fmt
- task: tidy
- task: lint
- task: test:race
- task: vuln
fmt:
desc: Verify formatting without rewriting anything
cmds:
- |
unformatted="$(gofmt -l .)"
if [ -n "$unformatted" ]; then
echo "gofmt — files need formatting:"
echo "$unformatted"
exit 1
fi
tidy:
desc: Verify go.mod/go.sum are minimal and complete
cmds:
- go mod tidy -diff
lint:
desc: Run golangci-lint (strict baseline in .golangci.yml; wraps vet and staticcheck)
cmds:
- "{{.GOLANGCI}} run"
test:
desc: Run the test suite (includes the SPI transcript harness)
cmds:
- go test ./...
test:race:
desc: Tests under the race detector — must stay clean even though a Radio is single-owner by contract
cmds:
- go test -race ./...
vuln:
desc: Scan dependencies for known vulnerabilities
cmds:
- "{{.GOVULNCHECK}} ./..."
build:
desc: Build the cmd/ tools into ./bin
cmds:
- go build -o bin/ ./cmd/...
build:arm64:
desc: Cross-compile lorabench for a 64-bit ARM board
cmds:
- GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o bin/lorabench-arm64 ./cmd/lorabench