-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
69 lines (57 loc) · 1.27 KB
/
Taskfile.yml
File metadata and controls
69 lines (57 loc) · 1.27 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
version: "3"
dotenv: [".env"]
vars:
BINARY: onecli
CMD_PATH: ./cmd/onecli
VERSION: '{{.VERSION | default "dev"}}'
tasks:
build:
desc: Build the onecli binary
cmds:
- go build -ldflags "-X main.version={{.VERSION}}" -o {{.BINARY}} {{.CMD_PATH}}
sources:
- ./**/*.go
generates:
- ./{{.BINARY}}
run:
desc: Build and run onecli
deps: [build]
cmds:
- ./{{.BINARY}} {{.CLI_ARGS}}
dev:
desc: Build and run onecli against local dev server
deps: [build]
cmds:
- ./{{.BINARY}} {{.CLI_ARGS}}
env:
ONECLI_ENV: dev
ONECLI_API_HOST: http://localhost:10254
test:
desc: Run all tests
cmds:
- go test ./...
test:race:
desc: Run tests with race detector
cmds:
- go test -race ./...
test:coverage:
desc: Run tests with coverage report
cmds:
- go test -coverprofile=coverage.out ./...
- go tool cover -html=coverage.out -o coverage.html
fmt:
desc: Format all Go files
cmds:
- gofmt -w .
lint:
desc: Run static analysis
cmds:
- golangci-lint run ./...
tidy:
desc: Clean up dependencies
cmds:
- go mod tidy
clean:
desc: Remove build artifacts
cmds:
- rm -f {{.BINARY}} coverage.out coverage.html