-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
59 lines (48 loc) · 1.43 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
version: '3'
env:
GOOS: # windows or linux ?
sh: go env GOOS
VERSION: # program version
sh: go run ./getversion/...
EXE: # executable extension (.exe or nothing)
sh: 'if [ "$(go env GOOS)" = "windows" ]; then echo ".exe"; else echo ""; fi'
BROWSER: # browser to open page
sh: 'if [ "$(go env GOOS)" = "windows" ]; then echo "Powershell Start-Process "; else echo "xdg-open"; fi'
tasks:
default:
desc: default task will display task menu (and update task itself)
cmds:
- go install github.com/go-task/task/v3/cmd/task@latest
- echo "default task will display task menu"
- task --list-all
version:
desc: display versionning information
cmds:
- task --version
- echo rgen version':' {{.VERSION}}
- echo "shell :" $0 $SHELL
- go version
build:
desc: build executable for current machine
cmds:
- go build ./...
test:
desc: run all tests and examples
cmds:
- go test -cover ./...
bench:
desc: run all benchmarks (30 times)
cmds:
- go test -bench=. -benchmem -cpu 2,8 -cover ./...
run:
desc: run executable
clean:
desc: remove all build artifacts
cmds:
- go clean
godoc:
desc: launch godoc viewer and open browser page on windows
cmds:
- go install golang.org/x/tools/cmd/godoc@latest
- $( {{.BROWSER }} "http://localhost:6060" ) &
- godoc -http='localhost:6060'