Skip to content

Commit

Permalink
pin protoc
Browse files Browse the repository at this point in the history
  • Loading branch information
mmetc committed Oct 4, 2024
1 parent 1fee88a commit ba694cc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,21 @@ jobs:
with:
go-version: "1.22"

- name: Run "make generate" and check for changes
- name: Run "go generate" and check for changes
run: |
set -e
sudo apt -qq -y -o=Dpkg::Use-Pty=0 install protobuf-compiler
# ensure the version of 'protoc' matches the one that generated the files
PROTOBUF_VERSION="21.12"
# don't pollute the repo
pushd $HOME
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOBUF_VERSION}/protoc-${PROTOBUF_VERSION}-linux-x86_64.zip
unzip protoc-${PROTOBUF_VERSION}-linux-x86_64.zip -d $HOME/.protoc
popd
export PATH="$HOME/.protoc/bin:$PATH"
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
go generate ./...
protoc --version
if [[ $(git status --porcelain) ]]; then
echo "Error: Uncommitted changes found after running 'make generate'. Please commit all generated code."
git diff
Expand Down

0 comments on commit ba694cc

Please sign in to comment.