-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTaskfile.dist.yaml
More file actions
113 lines (113 loc) · 3.41 KB
/
Copy pathTaskfile.dist.yaml
File metadata and controls
113 lines (113 loc) · 3.41 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
# Task is a task runner / build tool that aims
# to be simpler and easier to use.
# https://taskfile.dev/installation/
version: '3'
vars:
BINNAME: retrotxt
tasks:
default:
desc: 'Task runner for the retrotxt source code.'
cmds:
- task --list-all
silent: true
release:
desc: 'GoReleaser'
cmds:
- cmd: goreleaser release --snapshot --clean
doc:
desc: 'Generate and browse the application module documentation.'
cmds:
- cmd: pkgsite -http localhost:8090
silent: true
lint:
silent: false
desc: Runs the go formatter and lints the source code.
ignore_error: true
cmds:
- cmd: clear
platforms: [linux, darwin, freebsd]
- cmd: gci write ./..
- cmd: go fix ./...
- cmd: gofumpt -w .
- cmd: golangci-lint run
linter:
silent: false
desc: Lints the source code.
ignore_error: true
cmds:
- cmd: clear
platforms: [linux, darwin, freebsd]
- cmd: golangci-lint run
nil:
desc: 'Run the static analysis techniques to catch Nil dereferences.'
cmds:
- go tool nilaway -test=false ./...
build:
desc: 'Build the binary of the program.'
cmds:
- cmd: echo "Building..."
- cmd: go build -o {{.BINNAME}} -v main.go
platforms: [linux, darwin, freebsd]
- cmd: go build -o {{.BINNAME}}.exe -v main.go
platforms: [windows]
- cmd: echo "Done!"
buildr:
desc: 'Build the binary of the program with race detection.'
cmds:
- cmd: echo "Building with race conditions..."
- cmd: go build -o {{.BINNAME}} -race -v main.go
platforms: [linux, darwin, freebsd]
- cmd: go build -o {{.BINNAME}}.exe -race -v main.go
platforms: [windows]
- cmd: ./{{.BINNAME}} --version
platforms: [linux, darwin]
- cmd: ./{{.BINNAME}}.exe --version
platforms: [windows]
- cmd: echo "Done!"
test:
desc: 'Run the test suite.'
cmds:
- go test -count=1 ./...
testr:
desc: 'Run the verbose test suite with the slower race detection.'
cmds:
- go test -count=1 -race ./...
test-coverage:
desc: 'Run test suite with coverage analysis and generate HTML report.'
cmds:
- go test -count=1 -coverprofile=coverage.out ./...
- go tool cover -html=coverage.out -o coverage.html
test-coverage-detailed:
desc: 'Run detailed test coverage analysis with function-level breakdown.'
cmds:
- go test -count=1 -coverprofile=coverage.out -covermode=count ./...
- go tool cover -func=coverage.out
- go tool cover -html=coverage.out -o coverage.html
test-coverage-packages:
desc: 'Run test coverage analysis showing coverage by package.'
cmds:
- go test -count=1 -cover ./...
coverage-clean:
desc: 'Clean up coverage analysis files.'
cmds:
- rm -f coverage.out coverage.html
benchmark:
desc: 'Run performance benchmarks for the application.'
cmds:
- go test -bench=. -benchmem ./...
benchmark-detailed:
desc: 'Run detailed performance benchmarks with longer duration.'
cmds:
- go test -bench=. -benchmem -benchtime=5s ./...
pkg-patch:
silent: false
desc: Update and apply patches to the web server dependencies.
cmds:
- cmd: go get -u=patch -x
- cmd: go mod verify
pkg-update:
silent: false
desc: Update the web server dependencies.
cmds:
- cmd: go get -u -x
- cmd: go mod verify