+1029
-1510
lines changedFilter options
+1029
-1510
lines changed Original file line number Diff line number Diff line change
@@ -116,10 +116,9 @@ jobs:
116
116
- name: Install Go dependencies
117
117
run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.4.1
118
118
119
-
- name: Install protoc compiler
120
-
uses: arduino/setup-protoc@v3
119
+
- uses: bufbuild/buf-action@v1
121
120
with:
122
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
121
+
setup_only: true
123
122
124
123
- name: Install Task
125
124
uses: arduino/setup-task@v2
Original file line number Diff line number Diff line change
@@ -44,10 +44,9 @@ jobs:
44
44
- name: Install Go dependencies
45
45
run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.4.1
46
46
47
-
- name: Install protoc compiler
48
-
uses: arduino/setup-protoc@v3
47
+
- uses: bufbuild/buf-action@v1
49
48
with:
50
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
49
+
setup_only: true
51
50
52
51
- name: Install Python
53
52
uses: actions/setup-python@v5
Original file line number Diff line number Diff line change
@@ -53,21 +53,9 @@ jobs:
53
53
- name: Checkout repository
54
54
uses: actions/checkout@v4
55
55
56
-
- name: Install Go
57
-
uses: actions/setup-go@v5
56
+
- uses: bufbuild/buf-action@v1
58
57
with:
59
-
go-version: ${{ env.GO_VERSION }}
60
-
61
-
- name: Install protoc compiler
62
-
uses: arduino/setup-protoc@v3
63
-
with:
64
-
version: v26.1
65
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
66
-
67
-
- name: Install Go deps
68
-
run: |
69
-
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
70
-
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0
58
+
setup_only: true
71
59
72
60
- name: Install Task
73
61
uses: arduino/setup-task@v2
@@ -90,43 +78,15 @@ jobs:
90
78
- name: Checkout repository
91
79
uses: actions/checkout@v4
92
80
93
-
- name: Install Go
94
-
uses: actions/setup-go@v5
95
-
with:
96
-
go-version: ${{ env.GO_VERSION }}
97
-
98
-
- name: Install buf (protoc linter)
81
+
# used by the protobuf breaking change detector
82
+
- name: Fetch main branch
99
83
run: |
100
-
go install github.com/bufbuild/buf/cmd/buf@v1.20.0
101
-
go install github.com/bufbuild/buf/cmd/protoc-gen-buf-breaking@v1.20.0
102
-
go install github.com/bufbuild/buf/cmd/protoc-gen-buf-lint@v1.20.0
103
-
104
-
- name: Install Task
105
-
uses: arduino/setup-task@v2
106
-
with:
107
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
108
-
version: 3.x
109
-
110
-
- name: Lint protocol buffers
111
-
run: task protoc:check
84
+
git fetch origin master
112
85
113
-
check-formatting:
114
-
needs: run-determination
115
-
if: needs.run-determination.outputs.result == 'true'
116
-
runs-on: ubuntu-latest
117
-
118
-
steps:
119
-
- name: Checkout repository
120
-
uses: actions/checkout@v4
121
-
122
-
- name: Install Task
123
-
uses: arduino/setup-task@v2
86
+
- uses: bufbuild/buf-action@v1
124
87
with:
125
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
126
-
version: 3.x
127
-
128
-
- name: Format protocol buffers
129
-
run: task protoc:format
130
-
131
-
- name: Check formatting
132
-
run: git diff --color --exit-code
88
+
pr_comment: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
89
+
lint: ${{ github.event_name == 'pull_request' }}
90
+
format: ${{ github.event_name == 'pull_request' }}
91
+
breaking: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'buf skip breaking') }}
92
+
breaking_against: ".git#branch=origin/master,subdir=rpc"
Original file line number Diff line number Diff line change
@@ -64,10 +64,9 @@ jobs:
64
64
- name: Install Go dependencies
65
65
run: go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.4.1
66
66
67
-
- name: Install protoc compiler
68
-
uses: arduino/setup-protoc@v3
67
+
- uses: bufbuild/buf-action@v1
69
68
with:
70
-
repo-token: ${{ secrets.GITHUB_TOKEN }}
69
+
setup_only: true
71
70
72
71
- name: Install Python
73
72
uses: actions/setup-python@v5
Original file line number Diff line number Diff line change
@@ -232,16 +232,19 @@ tasks:
232
232
- protoc:check
233
233
- protoc:format
234
234
- protoc:compile
235
+
- protoc:breaking-change-detection
235
236
236
237
protoc:compile:
237
238
desc: Compile protobuf definitions
238
239
cmds:
239
-
- '{{ default "protoc" .PROTOC_BINARY }} --proto_path=rpc --go_out=./rpc --go_opt=paths=source_relative --go-grpc_out=./rpc --go-grpc_opt=paths=source_relative ./rpc/cc/arduino/cli/commands/v1/*.proto'
240
+
- buf dep update
241
+
- buf generate
240
242
241
243
protoc:docs:
242
244
desc: Generate docs for protobuf definitions
243
245
cmds:
244
-
- '{{ default "protoc" .PROTOC_BINARY }} --doc_out=./docs/rpc --doc_opt=markdown,commands.md --proto_path=rpc ./rpc/cc/arduino/cli/commands/v1/*.proto'
246
+
- |
247
+
buf generate --template buf.doc.gen.yaml
245
248
246
249
docs:include-configuration-json-schema:
247
250
desc: Copy configuration JSON schema to make it available in documentation
@@ -251,7 +254,7 @@ tasks:
251
254
protoc:check:
252
255
desc: Perform linting of the protobuf definitions
253
256
cmds:
254
-
- buf lint rpc
257
+
- buf lint
255
258
256
259
protoc:collect:
257
260
desc: Create a zip file containing all .proto files in DIST_DIR
@@ -263,7 +266,12 @@ tasks:
263
266
protoc:format:
264
267
desc: Perform formatting of the protobuf definitions
265
268
cmds:
266
-
- clang-format -i rpc/cc/arduino/cli/*/*/*.proto
269
+
- buf format --write --exit-code
270
+
271
+
protoc:breaking-change-detection:
272
+
desc: Detect protobuf breaking changes
273
+
cmds:
274
+
- buf breaking --against '.git#branch=origin/master,subdir=rpc'
267
275
268
276
build:
269
277
desc: Build the project
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
1
+
version: v2
2
+
plugins:
3
+
# Local plugin used to generate docs
4
+
# go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.4.1
5
+
- local: protoc-gen-doc
6
+
out: ./docs/rpc
7
+
opt:
8
+
- markdown,commands.md
9
+
inputs:
10
+
- directory: ./rpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
1
+
version: v2
2
+
plugins:
3
+
# Use protoc-gen-go
4
+
- remote: buf.build/protocolbuffers/go:v1.34.2
5
+
out: ./rpc
6
+
opt:
7
+
- paths=source_relative
8
+
# Use of protoc-gen-go-grpc
9
+
- remote: buf.build/grpc/go:v1.5.1
10
+
out: ./rpc
11
+
opt:
12
+
- paths=source_relative
13
+
inputs:
14
+
- directory: ./rpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1
+
# Generated by buf. DO NOT EDIT.
2
+
version: v2
3
+
deps:
4
+
- name: buf.build/googleapis/googleapis
5
+
commit: e7f8d366f5264595bcc4cd4139af9973
6
+
digest: b5:0cd69a689ee320ed815663d57d1bc3a1d6823224a7a717d46fee3a68197c25a6f5f932c0b0e49f8370c70c247a6635969a6a54af5345cafd51e0667298768aca
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
1
+
version: v2
2
+
deps:
3
+
- buf.build/googleapis/googleapis:e7f8d366f5264595bcc4cd4139af9973
4
+
breaking:
5
+
use:
6
+
- FILE
7
+
lint:
8
+
use:
9
+
- STANDARD
10
+
- COMMENT_ENUM
11
+
- COMMENT_ENUM_VALUE
12
+
- COMMENT_FIELD
13
+
- COMMENT_RPC
14
+
- COMMENT_SERVICE
15
+
ignore_only:
16
+
ENUM_ZERO_VALUE_SUFFIX:
17
+
- rpc/cc/arduino/cli/commands/v1/lib.proto
18
+
modules:
19
+
- path: rpc
Original file line number Diff line number Diff line change
@@ -79,13 +79,7 @@ If you want to run integration tests you will also need:
79
79
80
80
If you're working on the gRPC interface you will also have to:
81
81
82
-
- download and install the [protoc][6] compiler (use the version required to match the generated code, please note that
83
-
the latest releases does not follow semantic versioning anymore so, for example, the version 5.26.1 must be searched
84
-
as 26.1 dropping the major number)
85
-
- install `protoc-gen-go` using: `go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2` (use the version
86
-
required to match the generated code)
87
-
- install `protoc-gen-go-grpc` using: `go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3.0` (use the version
88
-
required to match the generated code)
82
+
- download and install [buf][6] our tool to compile and generate proto files
89
83
90
84
### Building the source code
91
85
@@ -337,7 +331,7 @@ If your PR doesn't need to be included in the changelog, please start the commit
337
331
[1]: https://go.dev/doc/install
338
332
[2]: https://taskfile.dev/#/installation
339
333
[3]: https://www.python.org/downloads/
340
-
[6]: https://github.com/protocolbuffers/protobuf/releases
334
+
[6]: https://buf.build/docs/installation/
341
335
[7]: https://pages.github.com/
342
336
[9]: https://www.mkdocs.org/
343
337
[11]: https://github.com/arduino/arduino-cli/blob/master/.github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4