forked from mantzas/patron
-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathTaskfile.yml
More file actions
93 lines (79 loc) · 2.18 KB
/
Taskfile.yml
File metadata and controls
93 lines (79 loc) · 2.18 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
# https://taskfile.dev
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
vars:
OTEL_INSECURE: "true"
TEST_TIMEOUT: 60s
INTEGRATION_TIMEOUT: 30s
CI_TIMEOUT: 2m
tasks:
validate:
desc: "Validate Taskfile.yml syntax and schema"
cmds:
- task --list > /dev/null && echo "✅ Taskfile.yml is valid"
silent: true
default:
desc: "Run tests (default task)"
cmds:
- task: test
test:
desc: "Run unit tests with race detection and coverage"
deps:
- fmtcheck
cmds:
- go test ./... -cover -race -timeout {{.TEST_TIMEOUT}}
testint:
desc: "Run integration tests with race detection and coverage"
deps:
- fmtcheck
cmds:
- go test ./... -race -cover -tags=integration -timeout {{.INTEGRATION_TIMEOUT}}
testint-nocache:
desc: "Run integration tests without cache"
deps:
- fmtcheck
cmds:
- go test ./... -race -cover -tags=integration -timeout {{.INTEGRATION_TIMEOUT}} -count=1
ci:
desc: "Run CI tests with coverage report"
cmds:
- go test `go list ./... | grep -v -e 'examples' -e 'encoding/protobuf/test'` -race -cover -coverprofile=coverage.txt -covermode=atomic -tags=integration -timeout {{.CI_TIMEOUT}}
fmt:
desc: "Format code with go fmt"
cmds:
- go fmt ./...
fmtcheck:
desc: "Check code formatting compliance"
cmds:
- sh -c "{{.CURDIR}}/script/gofmtcheck.sh"
vars:
CURDIR:
sh: pwd
lint:
desc: "Run linter with golangci-lint CLI"
deps:
- fmtcheck
cmds:
- golangci-lint run -v
env:
GOFLAGS: -mod=vendor
example-service:
desc: "Run example service with OTEL configuration"
cmds:
- go run examples/service/*.go
env:
OTEL_EXPORTER_OTLP_INSECURE: "{{.OTEL_INSECURE}}"
example-client:
desc: "Run example client with OTEL configuration"
cmds:
- go run examples/client/main.go
env:
OTEL_EXPORTER_OTLP_INSECURE: "{{.OTEL_INSECURE}}"
deps-start:
desc: "Start Docker Compose dependencies"
cmds:
- docker compose up -d --wait
deps-stop:
desc: "Stop Docker Compose dependencies"
cmds:
- docker compose down