forked from bangumi/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
112 lines (94 loc) · 2.02 KB
/
Taskfile.yaml
File metadata and controls
112 lines (94 loc) · 2.02 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"
dotenv: [".env", ".envrc"]
includes:
mock:
taskfile: "./etc/mock.task.yaml"
internal: true
tasks:
default:
silent: true
cmds:
- task --list
build:
desc: Build Web Server Binary
sources:
- ./**/*.go
- go.mod
generates:
- ./dist/chii.exe
cmds:
- go build -trimpath -o dist/chii.exe main.go
env:
CGO_ENABLED: "0"
lint:
silent: true
desc: Run 'golangci-lint'
cmds:
- golangci-lint --path-prefix "{{ .TASKFILE_DIR }}" run --fix
test:
desc: Run mocked tests, need nothing.
cmds:
- go test -timeout 3s -tags test {{.CLI_ARGS}} ./...
env:
CGO_ENABLED: "0"
web:
desc: Run Web Server
cmds:
- go run main.go --config config.yaml web
consumer:
desc: Run Kafka Consumer
cmds:
- go run main.go canal --config config.yaml
openapi-test:
desc: Test OpenAPI Schema
cmds:
- yarn run test
openapi:
desc: Build OpenAPI Schema
cmds:
- yarn run build
bench:
desc: Run benchmark
cmds:
- go test -bench=. -benchmem ./pkg/wiki
test-db:
desc: Run mocked tests, and tests require mysql and redis. alias for `TEST_MYSQL=1 TEST_REDIS=1 task test`
cmds:
- go test -timeout 10s -tags test {{.CLI_ARGS}} ./...
env:
TEST_MYSQL: "1"
TEST_REDIS: "1"
test-all:
desc: Run all tests.
cmds:
- go test -timeout 10s -tags test ./...
env:
TEST_MYSQL: "1"
TEST_REDIS: "1"
mod:
desc: "go mod tidy"
cmds:
- go mod tidy
gen:
desc: Generate all generated GO files
cmds:
- task: gorm
- task: mock
mock:
desc: Generate Mocks.
deps:
- mock:all
gorm:
desc: Run gorm-gen to generate go struct from mysql database.
generates:
- ./dal/query/gen.go
sources:
- ./cmd/gen/gorm/main.go
- go.mod
cmds:
- go run --tags gen ./cmd/gen/gorm/main.go
clean:
cmds:
- rm -rf ./dist/
- rm -rf .task
- rm -rf .bin