-
Notifications
You must be signed in to change notification settings - Fork 2
/
Taskfile.yaml
53 lines (46 loc) · 1.43 KB
/
Taskfile.yaml
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
version: '3'
vars:
CONTRACT_DIR: .
GENERATE_DIR: gen
tasks:
all:
desc: Format, Lint, check for breaking changes, then generate all models, clients, and server stubs
cmds:
- task: format
- task: lint
- task: breaking
- task: generate
generate:
desc: Generate all proto stubs for all supported languages
dir: "{{.CONTRACT_DIR}}"
cmds:
- cmd: rm -rf generated/go/porter; rm -rf generated/js/src;
ignore_error: false
- cmd: buf generate --config buf.yaml --template buf.gen.yaml
ignore_error: false
breaking:
desc: Check for breaking changes against main branch
dir: "{{.CONTRACT_DIR}}"
cmds:
- cmd: buf breaking --config buf.yaml --against .git#branch=main,subdir=.
ignore_error: false
lint:
desc: Lint proto files for consistency
dir: "{{.CONTRACT_DIR}}"
cmds:
- cmd: buf lint
ignore_error: false
format:
desc: Format proto files for consistency
dir: "{{.CONTRACT_DIR}}"
cmds:
- cmd: buf format -w
ignore_error: false
install-tools:
desc: Install commonly used tools for gRPC
cmds:
- go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
- go install github.com/bufbuild/buf/cmd/buf@latest
- go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
- go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
- npm install -g @bufbuild/protobuf @bufbuild/protoc-gen-es