-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaskfile.yaml
More file actions
158 lines (132 loc) · 3.31 KB
/
taskfile.yaml
File metadata and controls
158 lines (132 loc) · 3.31 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
version: '3'
dotenv: ['.env.local']
vars:
GOLANG_WORKSPACES: ./internal/...
GOLANG_COVERAGE: coverage.out
tasks:
build:
desc: Build the application.
deps: [gen, go-ci, frontend-ci]
cmds:
- wails build
dev:
desc: Run the application in development mode.
deps: [gen]
cmds:
- wails dev
db-clean:
desc: Clean the database.
cmds:
- rm -f $LOCAL_DEV_DIR/watchtower.db
db-migrate:
desc: Run database migrations.
deps: [gen]
cmds:
- go run ./cmd/local
gen:
desc: Generate go code.
cmds:
- sqlc generate
- go generate ./...
go-lint:
desc: Run go linters.
cmds:
- golangci-lint run {{ .GOLANG_WORKSPACES }} --fix
- govulncheck {{ .GOLANG_WORKSPACES }}
- go fmt {{ .GOLANG_WORKSPACES }}
-
go-lint-watch:
desc: Run go linters in watch mode.
watch: true
sources:
- ./**/*.go
cmds:
- task: go-lint
go-install:
desc: Install go dependencies.
deps: [go-install-tools]
cmds:
- go mod tidy
- go mod download
go-install-tools:
desc: Install CI tools
cmds:
- go install github.com/matryer/moq@latest
- go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
- go install golang.org/x/vuln/cmd/govulncheck@latest
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.2.2
go-test:
desc: Run go tests.
deps: [gen]
cmds:
- go test -cover -coverprofile={{ .GOLANG_COVERAGE }} -failfast {{ .GOLANG_WORKSPACES }}
go-watch:
desc: Run go tests in watch mode.
cmds:
- gow test -cover -coverprofile={{ .GOLANG_COVERAGE }} -failfast {{ .GOLANG_WORKSPACES }}
go-gen-coverage:
desc: Generate go coverage.
deps: [go-test]
cmds:
- grep -v -E -f ${PWD}/.covignore {{ .GOLANG_COVERAGE }} > coverage.filtered.out
- mv coverage.filtered.out {{ .GOLANG_COVERAGE }}
go-cover:
desc: Run go coverage.
deps: [go-gen-coverage]
cmds:
- go tool cover -func={{ .GOLANG_COVERAGE }} | grep total
go-cover-html:
desc: Run go coverage html.
deps: [go-gen-coverage]
cmds:
- go tool cover -html={{ .GOLANG_COVERAGE }}
go-ci:
desc: Run go ci tasks.
cmds:
- task: go-lint
- task: go-cover
frontend-install:
desc: Install frontend dependencies.
dir: frontend
cmds:
- npm install
frontend-format:
desc: Run frontend formatters.
dir: frontend
cmds:
- npm run format
- npm run lint:fix
frontend-test:
desc: Run frontend unit tests.
dir: frontend
cmds:
- npm run test:coverage
frontend-watch:
desc: Run frontend unit tests in watch mode.
dir: frontend
cmds:
- npm run test:unit
frontend-lint:
desc: Run frontend linters.
dir: frontend
cmds:
- npm run lint
frontend-check:
desc: Run frontend checks.
dir: frontend
cmds:
- npm run check
frontend-ci:
desc: Run frontend ci tasks.
dir: frontend
deps: [frontend-lint, frontend-check, frontend-test]
reset:
desc: Reset the application.
deps: [db-clean]
cmds:
- task: dev
tools-get:
desc: Get go dev tools.
cmds:
- go install golang.org/x/vuln/cmd/govulncheck@latest
- go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.2.2