-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.39 KB
/
check-go-generate.yml
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
name: Check go generate
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
check-go-generate:
name: Check make generate-go
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21' # Specify the Go version you're using
- name: Install protoc-gen-go and protoc-gen-go-grpc
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
go install github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]
go install github.com/grpc-ecosystem/grpc-gateway/v2/[email protected]
echo "${HOME}/go/bin" >> $GITHUB_PATH
- uses: bufbuild/[email protected]
with:
version: 1.32.1
- name: Check buf installation
run: buf --version
- name: Run make generate
run: make generate
- name: Check if make generate-go generated changes that should be committed
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: make generate-go generated changes that should be committed. Please run 'make generate-go' and commit the changes."
git diff
git status
exit 1
fi