-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yml
More file actions
63 lines (51 loc) · 1.19 KB
/
Copy pathTaskfile.yml
File metadata and controls
63 lines (51 loc) · 1.19 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
version: "3"
env:
DB_PATH: '{{.DB_PATH | default "didntmaker.db"}}'
vars:
MIGRATIONS_DIR: db/migrations
tasks:
default:
desc: Format, generate and build (quick pre-commit check)
cmds:
- task: fmt
- task: generate
- task: build
tools:
desc: Install dev tools (sqlc, goose)
cmds:
- go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
- go install github.com/pressly/goose/v3/cmd/goose@latest
generate:
desc: Generate type-safe DB code from db/queries via sqlc
aliases: [sqlc]
cmds:
- sqlc generate
migrate:
desc: Apply embedded migrations to $DB_PATH
aliases: [migrate:up]
cmds:
- go run ./cmd/migrate
migrate:create:
desc: "Scaffold a new SQL migration — usage: task migrate:create -- <name>"
cmds:
- goose -dir {{.MIGRATIONS_DIR}} create {{.CLI_ARGS}} sql
build:
desc: Build the bot binary
cmds:
- go build -o bin/bot ./cmd/bot
run:
desc: Run the bot
cmds:
- go run ./cmd/bot
test:
desc: Run tests
cmds:
- go test ./...
fmt:
desc: Format Go code
cmds:
- go fmt ./...
tidy:
desc: Tidy go modules
cmds:
- go mod tidy