5353 - name : Checkout repository
5454 uses : actions/checkout@v4
5555
56- - name : Install Go
57- uses : actions/setup-go@v5
56+ - uses : bufbuild/buf-action@v1
5857 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
7159
7260 - name : Install Task
7361 uses : arduino/setup-task@v2
@@ -90,43 +78,15 @@ jobs:
9078 - name : Checkout repository
9179 uses : actions/checkout@v4
9280
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
9983 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
11285
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
12487 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"
0 commit comments