-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
45 lines (40 loc) · 1.6 KB
/
Taskfile.yml
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
version: '3'
tasks:
build:
desc: Build the video-ligtning-detector for the current system and architecture with debug symbols included.
cmds:
- cmd: go build -v -o bin/video-lightning-detector.exe .
platforms: [ windows ]
- cmd: go build -v -o bin/video-lightning-detector .
platforms: [ linux, darwin ]
test:
desc: Run tests for all packages.
cmds:
- go test ./...
test:cover:
desc: Run tests for all packages and generate a coverage report.
vars:
COVERAGE: coverage.out
cmds:
- go test -coverprofile {{.COVERAGE}} ./...
- go tool cover -html {{.COVERAGE}}
profile:
desc: Run a profiling test with given arguments (task profile --args) and display the pprof tool results.
vars:
CPU_PROFILE: cpu.prof
MEM_PROFILE: mem.prof
cmds:
- VLD_CLI_ARGS="{{.CLI_ARGS}}" go test -v -cpuprofile {{.CPU_PROFILE}} -memprofile {{.MEM_PROFILE}} -run ^$ -bench .
- go tool pprof -text {{.CPU_PROFILE}}
- go tool pprof -text {{.MEM_PROFILE}}
profile:graph:
desc: Run a profiling test with given arguments (task profile:graph -- <args>) and create a visualization using Graphviz.
vars:
CPU_PROFILE: cpu.prof
MEM_PROFILE: mem.prof
CPU_PROFILE_GRAPH: cpu-profile.svg
MEM_PROFILE_GRAPH: mem-profile.svg
cmds:
- VLD_CLI_ARGS="{{.CLI_ARGS}}" go test -v -cpuprofile {{.CPU_PROFILE}} -memprofile {{.MEM_PROFILE}} -run ^$ -bench .
- go tool pprof -svg -output {{.CPU_PROFILE_GRAPH}} {{.CPU_PROFILE}}
- go tool pprof -svg -output {{.MEM_PROFILE_GRAPH}} {{.MEM_PROFILE}}