Skip to content

Commit

Permalink
fix: regenerate proto files for v3 (#1673)
Browse files Browse the repository at this point in the history
* regenerate proto files for v3

* add proto workflow

* on every pr

* temp

* remove branch

* move folder

* remove lint

* use specific tag

* add tag

* more

* more

* add go path

* done

* test

* undo test

* fix init_install

---------

Co-authored-by: Yarom Swisa <[email protected] git config --global user.name Yarom>
  • Loading branch information
Yaroms and Yarom Swisa authored Sep 4, 2024
1 parent e576026 commit b1c2812
Show file tree
Hide file tree
Showing 77 changed files with 1,642 additions and 1,538 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/proto.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Protobuf
# Protobuf runs buf (https://buf.build/) lint and check-breakage
# This workflow is only run when a .proto file has been changed
on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
# lint:
# runs-on: ubuntu-latest
# timeout-minutes: 5
# steps:
# - uses: actions/checkout@v4
# - uses: bufbuild/[email protected]
# - uses: bufbuild/buf-lint-action@v1
# with:
# input: "proto"

break-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/[email protected]
- uses: bufbuild/buf-breaking-action@v1
with:
input: "proto"
against: "https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto"

validate-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20.5

- name: export PATH
run: export PATH=$PATH:/go:/go/bin:$(go env GOPATH)/bin:/usr/local:`pwd`:/home/runner/work/lava/lava/
- name: export GOPATH
run: export GOPATH=$GOPATH:$(go env GOPATH):/go:/go/lava:/usr/local:`pwd`

- name: install grpc gateway
run: |
git clone https://github.com/grpc-ecosystem/grpc-gateway -b v1.16.0
cd grpc-gateway
go mod download
go install \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
github.com/golang/protobuf/protoc-gen-go
cd ..
rm -rf grpc-gateway
- name: install buf
run: |
BIN="/usr/local/bin" && \
VERSION="1.25.0" && \
curl -sSL \
"https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-$(uname -s)-$(uname -m)" \
-o "${BIN}/buf" && \
chmod +x "${BIN}/buf"
- name: install proto cosmos
run: |
git clone https://github.com/cosmos/gogoproto.git -b v1.4.9
cd gogoproto
go mod download
make install
cd ..
rm -rf gogoproto
- name: generate proto
run: |
./scripts/protocgen.sh
- name: Check for differences
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "Error: The generated .pb.go files are not up to date."
git diff
exit 1
fi
shell: bash



14 changes: 13 additions & 1 deletion scripts/init_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ if ! $jq_installed; then
fi

############################# BUF INSTALLATION ######################################
if ! command_exists protoc-gen-grpc-gateway; then
git clone https://github.com/grpc-ecosystem/grpc-gateway -b v1.16.0
cd grpc-gateway
go mod download
go install \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway \
github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger \
github.com/golang/protobuf/protoc-gen-go
cd ..
rm -rf grpc-gateway
fi


if ! command_exists buf; then
if [[ "$OSTYPE" == "darwin"* ]]; then
Expand Down Expand Up @@ -73,7 +85,7 @@ else
fi

if ! command_exists protoc-gen-gocosmos; then
git clone https://github.com/cosmos/gogoproto.git
git clone https://github.com/cosmos/gogoproto.git -b v1.4.9
cd gogoproto
go mod download
make install
Expand Down
48 changes: 24 additions & 24 deletions x/conflict/types/conflict_data.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 27 additions & 27 deletions x/conflict/types/conflict_vote.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x/conflict/types/genesis.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions x/conflict/types/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions x/conflict/types/query.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b1c2812

Please sign in to comment.