-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
109 lines (95 loc) · 3.57 KB
/
Copy pathTaskfile.yml
File metadata and controls
109 lines (95 loc) · 3.57 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
# https://taskfile.dev
version: '3'
vars:
BENCH_TIME: 2s
tasks:
default:
desc: Show available tasks
cmds:
- task --list
build:
desc: Build all packages
cmds:
- go build ./...
test:
desc: Run all tests (verbose)
cmds:
- go test -v ./...
test:short:
desc: Run all tests
cmds:
- go test ./...
test:race:
desc: Run tests with the race detector
cmds:
# Deliberately no -count=1, unlike CI's race steps, where the flag exists
# because setup-go restores a GOCACHE from a different run and a cached ok
# could satisfy a lane that ran nothing. Locally the cache is
# content-addressed, so a hit means this machine really did run these
# bytes, and the cost of the flag would be paid on every `task check`
# rather than only on a re-run. The counter-argument is real and this is a
# judgment call rather than a settled one: a race-detector result is not a
# pure function of the input, so caching one does hide a flake that a
# re-run might surface. If flake hunting starts to matter more than the
# turnaround, add -count=1 here and to test:noasm together.
- go test -race ./...
test:noasm:
desc: Run the race tests against the scalar fallback (-tags noasm)
cmds:
- go test -race -tags noasm ./...
test:norace:
desc: Run the suite without the race detector
cmds:
# Not redundant with test:race. Several tests deliberately shrink or skip
# under the detector, so they only ever execute here: the edge-config soak
# drops its in-range bitrates, TestEncoderToolWiring skips outright, and
# pcm's TestEncodeInterleavedReuseAllocs drops its zero-allocation bound.
# CI gained this lane for the same reason; without it locally, a green
# `task check` says nothing about any of them.
- go test -count=1 ./...
bench:
desc: Run all benchmarks
cmds:
- go test -bench=. -benchmem -benchtime={{.BENCH_TIME}} ./...
vet:
desc: Run go vet for amd64 and arm64, all three tag settings
cmds:
- GOARCH=amd64 go vet ./...
- GOARCH=arm64 go vet ./...
- GOARCH=amd64 go vet -tags noasm ./...
- GOARCH=arm64 go vet -tags noasm ./...
# The race-tagged files (edge_soak_race_test.go, pcm/raceflag_race_test.go)
# are compiled by neither pass above. The race test lanes do compile them,
# but with the compiler, not with vet, so without this they are never
# vetted at all.
- GOARCH=amd64 go vet -tags race ./...
- GOARCH=arm64 go vet -tags race ./...
lint:
desc: Run golangci-lint for all three tag settings
cmds:
- golangci-lint run ./...
# The noasm files are invisible to the default run, so a violation in
# them only shows up here and in CI's lint matrix.
- golangci-lint run --build-tags noasm ./...
# Same for the race-tagged files, which no other lane lints.
- golangci-lint run --build-tags race ./...
tidy:
desc: Tidy and verify go.mod
cmds:
- go mod tidy
- go mod verify
hooks:install:
desc: Point git at the repo's .githooks directory
cmds:
- git config core.hooksPath .githooks
check:
desc: Full local gate (build, vet, lint, race tests, noasm race tests, non-race tests)
cmds:
- task: build
- task: vet
- task: lint
- task: test:race
# CI vets, lints and tests every tag setting, so the local gate does too;
# a noasm-only or race-only failure is otherwise invisible until push.
- task: test:noasm
- task: test:norace