-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.yml
More file actions
119 lines (107 loc) · 2.92 KB
/
Taskfile.yml
File metadata and controls
119 lines (107 loc) · 2.92 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
# https://taskfile.dev/usage
version: '3'
tasks:
default:
cmds:
- task: build
01_setup:
desc: 'Instal dev tools'
aliases:
- setup
- s
cmds:
# https://golangci-lint.run/welcome/install/
- brew install golangci-lint
- brew upgrade golangci-lint
- task: 01_setup-bats
- pip install --user mkdocs
# parse profiling data
- go install github.com/google/pprof@latest
01_setup-bats:
desc: 'Install bats testing tools'
aliases:
- setup-bats
cmds:
- git clone https://github.com/bats-core/bats-core.git bats-test/bats
- git clone https://github.com/bats-core/bats-support.git bats-test/test_helper/bats-support
- git clone https://github.com/bats-core/bats-assert.git bats-test/test_helper/bats-assert
03_generate-bats-tests:
desc: Generate resources to test against
aliases:
- gt
dir: ./bats-test
env:
KR8: '../kr8'
cmds:
- ./GEN_ALL.sh
03_test-go:
desc: Test kr8+ for your local system
aliases:
- test
- t
cmds:
- golangci-lint run
- go test -cover ./pkg/*
- task: 02_build
- task: 03_test-package
03_test-package:
desc: Test compiled kr8+ binary against test inputs
aliases:
- test-package
- tp
dir: ./bats-test
env:
KR8: '../kr8'
cmds:
- ./TEST_ALL.sh
02_build:
desc: Build kr8+ for your local system
aliases:
- build
- b
cmds:
- go fmt
- go generate ./docs
- go build
- task: 02_build-mkdocs
02_build-mkdocs:
desc: Uses mkdocs to build documentation site from docs
aliases: ["bmd"]
cmds:
# references mkdocs.yml
- mkdocs build
03_build-snapshot:
desc: Build a snapshot for all platforms using goreleaser
aliases:
- build-snapshot
- bs
cmds:
- go generate ./docs
- goreleaser release --snapshot --clean --skip=homebrew,docker
04_generate-examples:
desc: Generate example clusters and components with kr8+
aliases:
- ge
- gen
cmds:
- task: 02_build
- ./kr8 generate -B examples {{.CLI_ARGS}}
04_format-examples:
desc: Generate example clusters and components with kr8+
aliases:
- fmt
- format
cmds:
- task: 02_build
- ./kr8 format -B examples {{.CLI_ARGS}}
04_profile-generate:
desc: Capture profiling data from a kr8 generate of the examples.
aliases:
- profile
cmds:
- mkdir -p ./profiling
- ./kr8 generate -B examples --profiledir ./profiling {{.CLI_ARGS}}
- go tool pprof -png -output ./profiling/kr8-cpu.png ./kr8 ./profiling/profile_cpu.pb.gz
- go tool pprof -png -output ./profiling/kr8-heap.png ./kr8 ./profiling/profile_heap.pb.gz
#- go tool pprof -http=0.0.0.0:8654 ./kr8 ./profiling/profile_cpu.pb.gz
#- go tool pprof -http=0.0.0.0:8654 ./kr8 ./profiling/profile_heap.pb.gz