-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yml
More file actions
72 lines (60 loc) · 1.28 KB
/
taskfile.yml
File metadata and controls
72 lines (60 loc) · 1.28 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
version: '3'
tasks:
build:
desc: Build the cozyctl CLI binary
cmds:
- go build -ldflags "-s -w" -o ./bin/cozyctl .
sources:
- '**/*.go'
- go.mod
- go.sum
generates:
- ./bin/cozyctl
install:
desc: Install cozy CLI to $GOPATH/bin
cmds:
- go install .
run:
desc: Build and run the CLI
deps: [build]
cmds:
- ./bin/cozyctl {{.CLI_ARGS}}
test:
desc: Run all tests
cmds:
- go test -v ./...
test:coverage:
desc: Run tests with coverage report
cmds:
- go test -v -coverprofile=coverage.out ./...
- go tool cover -html=coverage.out -o coverage.html
- echo "Coverage report generated at coverage.html"
lint:
desc: Run linters
cmds:
- go vet ./...
- go fmt ./...
clean:
desc: Clean build artifacts
cmds:
- rm -rf ./bin
- rm -f coverage.out coverage.html
deps:
desc: Download and tidy dependencies
cmds:
- go mod download
- go mod tidy
help:
desc: Show CLI help
deps: [build]
cmds:
- ./bin/cozyctl --help
login:
desc: Run login command
deps: [build]
cmds:
- ./bin/cozyctl login {{.CLI_ARGS}}
default:
desc: Default task - build the project
cmds:
- task: build