File tree 3 files changed +33
-2
lines changed
3 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 22
22
- name : Install Go
23
23
uses : actions/setup-go@v2
24
24
with :
25
- go-version : " 1.14 "
25
+ go-version : " 1.16 "
26
26
27
27
- name : Install Go deps
28
28
# Since 10/23/2019 pwsh is the default shell
@@ -50,16 +50,27 @@ jobs:
50
50
- name : Install Poetry
51
51
run : pip install poetry
52
52
53
+ - name : Install buf (protoc linter)
54
+ if : runner.os == 'Linux'
55
+ run : |
56
+ go install github.com/bufbuild/buf/cmd/buf@latest
57
+ go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@latest
58
+ go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@latest
59
+ shell : bash
60
+
53
61
- name : Check the code is good
62
+ if : runner.os == 'Linux'
54
63
run : task check
55
64
56
65
- name : Install protoc compiler
66
+ if : runner.os == 'Linux'
57
67
uses : arduino/setup-protoc@v1
58
68
with :
59
69
repo-token : ${{ secrets.GITHUB_TOKEN }}
60
70
61
71
- name : Check protocol buffers compile correctly
62
- run : task protoc
72
+ if : runner.os == 'Linux'
73
+ run : task protoc:compile
63
74
64
75
- name : Build the CLI
65
76
run : task build
Original file line number Diff line number Diff line change @@ -77,6 +77,13 @@ tasks:
77
77
- npx {{ .PRETTIER }} --write "**/*.md"
78
78
79
79
protoc :
80
+ desc : Lint, format and compile protobuf definitions
81
+ deps :
82
+ - protoc:check
83
+ - protoc:format
84
+ - protoc:compile
85
+
86
+ protoc:compile :
80
87
desc : Compile protobuf definitions
81
88
cmds :
82
89
- ' {{ default "protoc" .PROTOC_BINARY }} --proto_path=rpc --go_out=plugins=grpc,paths=source_relative:rpc ./rpc/cc/arduino/cli/commands/v1/*.proto'
@@ -92,6 +99,16 @@ tasks:
92
99
- ' {{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,settings.md --proto_path=rpc ./rpc/cc/arduino/cli/settings/v1/*.proto'
93
100
- ' {{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,debug.md --proto_path=rpc ./rpc/cc/arduino/cli/debug/v1/*.proto'
94
101
102
+ protoc:check :
103
+ desc : Perform linting of the protobuf definitions
104
+ cmds :
105
+ - buf lint rpc
106
+
107
+ protoc:format :
108
+ desc : Perform formatting of the protobuf definitions
109
+ cmds :
110
+ - clang-format -i rpc/cc/arduino/cli/*/*/*.proto
111
+
95
112
build :
96
113
desc : Build the project
97
114
cmds :
@@ -134,6 +151,7 @@ tasks:
134
151
- task : python:check
135
152
- task : docs:check
136
153
- task : config:check
154
+ - task : protoc:check
137
155
138
156
config:check :
139
157
desc : Check linting of configuration and supporting files
Original file line number Diff line number Diff line change 4
4
ENUM_ZERO_VALUE_SUFFIX :
5
5
- cc/arduino/cli/commands/v1/lib.proto
6
6
- cc/arduino/cli/monitor/v1/monitor.proto
7
+ RPC_REQUEST_STANDARD_NAME :
8
+ - cc/arduino/cli/debug/v1/debug.proto
You can’t perform that action at this time.
0 commit comments