1# https://taskfile.dev
2
3version: "3"
4
5env:
6 CGO_ENABLED: 0
7 GOEXPERIMENT: greenteagc
8
9tasks:
10 lint:
11 desc: Run base linters
12 cmds:
13 - golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m
14
15 lint-fix:
16 desc: Run base linters and fix issues
17 cmds:
18 - golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m --fix
19
20 test:
21 desc: Run tests
22 cmds:
23 - go test ./... {{.CLI_ARGS}}
24
25 fmt:
26 desc: Run gofumpt
27 cmds:
28 - gofumpt -w .
29
30 dev:
31 desc: Run with profiling enabled
32 env:
33 CRUSH_PROFILE: true
34 cmds:
35 - go run .
36
37 install:
38 desc: Install the application
39 cmds:
40 - go install -v .
41
42 profile:cpu:
43 desc: 10s CPU profile
44 cmds:
45 - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/profile?seconds=10'
46
47 profile:heap:
48 desc: Heap profile
49 cmds:
50 - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/heap'
51
52 profile:allocs:
53 desc: Allocations profile
54 cmds:
55 - go tool pprof -http :6061 'http://localhost:6060/debug/pprof/allocs'
56
57 schema:
58 desc: Generate JSON schema for configuration
59 cmds:
60 - go run main.go schema > schema.json
61 - echo "Generated schema.json"