-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (61 loc) · 2.15 KB
/
check-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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Check make 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-go
run: make generate-go
- 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
check-rust-generate:
name: Check make generate-rs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Rust
uses: dtolnay/[email protected]
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- name: Run make generate-rs
run: make generate-rs
- name: Check if make generate-rs generated changes that should be committed
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "Error: make generate-rs generated changes that should be committed. Please run 'make generate-rs' and commit the changes."
git diff
git status
exit 1
fi