-
Notifications
You must be signed in to change notification settings - Fork 9
/
taskfile.yml
104 lines (86 loc) · 2.26 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
version: "3"
env:
SCAFFOLD_LOG_LEVEL: "debug"
SCAFFOLD_NO_CLOBBER: true
SCAFFOLD_OUT: "gen"
SCAFFOLD_DIR: ".scaffold,.examples"
SCAFFOLD_SETTINGS_LOG_LEVEL: "debug"
SCAFFOLD_SETTINGS_LOG_FILE: "./scaffold.log"
dotenv:
- .env
tasks:
run:
desc: Runs the main application and supports passing CLI args
cmds:
- go run *.go {{ .CLI_ARGS }}
silent: false
build:
desc: Builds the backend binary
cmds:
- goreleaser build --snapshot --clean
test:
desc: Runs all go tests using gotestsum - supports passing gotestsum args
cmds:
- gotestsum {{ .CLI_ARGS }} ./...
test:watch:
desc: Runs all go tests using gotestsum in watch mode
cmds:
- gotestsum --watch -- -v ./...
test:scripts:
desc: Runs all go tests for the scripts
cmds:
- ./tests/runner.sh
coverage:
desc: Runs all go tests with -race flag and generates a coverage report
cmds:
- go test -race -coverprofile=coverage.out -covermode=atomic ./... -v -cover
silent: true
tidy:
desc: Runs go mod tidy on the backend
cmds:
- go mod tidy
lint:
desc: Runs golangci-lint
cmds:
- golangci-lint run ./...
format:
desc: Runs gofmt on the backend
cmds:
- gofumpt -w ./
pr:
desc: Runs all go test and lint related tasks for PRs
cmds:
- task: tidy
- task: format
- task: lint
- task: test
printer:
desc: Runs the main.go program with the dev printer command for testing output
cmds:
- go run main.go dev printer
do:cli:
desc: Runs the main.go program with the cli scaffold
cmds:
- rm -rf ./gen/*
- go run main.go new cli
- go run ./gen/*/main.go
do:funcs:
desc: Runs the main.go program with the cli scaffold
cmds:
- rm -rf ./gen/*
- go run main.go --output-dir=":memory:" new funcs
do:role:
desc: Runs the main.go program with the role scaffold
cmds:
- rm -rf ./gen/*
- go run main.go new role
do:prompt:
desc: Runs the main.go program with the prompt scaffold
cmds:
- rm -rf ./gen/*
- go run main.go --output-dir=":memory:" new prompts
docs:
dir: docs
desc: Starts the development server for the documentation
cmds:
- npm run dev