-
Notifications
You must be signed in to change notification settings - Fork 0
/
taskfile.yml
108 lines (84 loc) · 1.53 KB
/
taskfile.yml
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
version: 3
tasks:
tidy:
cmds:
- go mod tidy
run:
deps:
- db:up
cmds:
- go run cmd/server/main.go
- defer: db:down
dev:
deps:
- db:up
cmds:
- wgo run -file .go cmd/server/main.go
- defer: db:down
# COUPLED DB-BACKEND
start:
run: once
cmds:
- docker compose --profile debug up -d
# DB
db:
cmds:
- go generate ./ent
db:new:
cmds:
- go run -mod=mod entgo.io/ent/cmd/ent new {{.CLI_ARGS}}
db:up:
run: once
cmds:
- docker compose up -d
db:down:
run: once
cmds:
- docker compose down
# PRETTIER - LINTER
lint:
cmds:
- golangci-lint run --tests=false
format:
cmds:
- gofmt -w -s .
# TEST
test:
cmds:
- gotestsum --format pkgname {{.ARGS}} -- {{.TEST_ARGS}} ./...
test:watch:
cmds:
- task: test
vars:
ARGS: --watch
test:cov:
cmds:
- task: test
vars:
TEST_ARGS: -coverprofile=out/coverage.out
test:watch:cov:
cmds:
- task: test
vars:
TEST_ARGS: -coverprofile=out/coverage.out
ARGS: --watch
test:report:
deps: [test:cov]
cmds:
- go tool cover -html=out/coverage.out
# BUILD
build:
cmds:
- go build -o bin/{{default "server" .NAME}} cmd/server/main.go
build:win:
cmds:
- task: build
vars:
NAME: server.exe
env:
GOOS: windows
GOARCH: amd64
# OTHERS
lab:
cmds:
- wgo run cmd/lab/main.go