feat: CNS-short-block-script #179
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/buf-setup-action@v1.38.0 | |
# - uses: bufbuild/buf-lint-action@v1 | |
# with: | |
# input: "proto" | |
break-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bufbuild/buf-setup-action@v1.38.0 | |
- 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 | |