-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
112 lines (93 loc) · 2.06 KB
/
Copy pathTaskfile.yml
File metadata and controls
112 lines (93 loc) · 2.06 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
version: '3'
vars:
BIN_DIR: ./bin
COVER_PROFILE: coverage.out
LINT_CONFIG: .golangci.yml
env:
GO111MODULE: on
CGO_ENABLED: 0
tasks:
# Build tasks
build:
desc: Build the project
cmds:
- go build -o {{.BIN_DIR}}/gotya ./cli/gotya
generate:
desc: Generate code
cmds:
- go generate ./...
generates:
- '**/mocks/*.go'
install:
desc: Install the application
cmds:
- go install ./cli/gotya
# Test tasks
test:
desc: Run all tests
cmds:
- go test -short ./... -coverprofile={{.COVER_PROFILE}}
test-integration:
desc: Run integration tests
cmds:
- go test -tags=integration ./... -coverprofile=integration-{{.COVER_PROFILE}}
test-all:
desc: Run all tests including integration tests
cmds:
- task: test
- task: test-integration
test-cover:
desc: Run tests and show coverage
deps:
- test
cmds:
- go tool cover -func={{.COVER_PROFILE}}
test-cover-html:
desc: Generate HTML coverage report
deps:
- test
cmds:
- go tool cover -html={{.COVER_PROFILE}} -o coverage.html
install-go-mutesting:
desc: Install go-mutesting
cmds:
- go install github.com/avito-tech/go-mutesting/cmd/go-mutesting@latest
mutate:
desc: Run mutation testing on the codebase
deps:
- install-go-mutesting
cmds:
- go-mutesting ./pkg/...
mutate-verbose:
desc: Run mutation testing with verbose output
deps:
- install-go-mutesting
cmds:
- go-mutesting --debug ./pkg/...
# Lint and format
lint:
desc: Run linters
cmds:
- golangci-lint run ./...
-
lint-fix:
desc: Run linters
cmds:
- golangci-lint run ./... --fix
fmt:
desc: Format Go code
cmds:
- go fmt ./...
tidy:
desc: Tidy Go modules
cmds:
- go mod tidy
# Cleanup
clean:
desc: Clean build artifacts
cmds:
- go clean
- rm -rf {{.BIN_DIR}} {{.COVER_PROFILE}} coverage.html
check:
desc: Run all checks (lint, test)
deps: [lint, test]