From ba694cce479fc8d8227b1946c40efc1f0deb7287 Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 4 Oct 2024 09:38:08 +0200 Subject: [PATCH] pin protoc --- .github/workflows/go-tests.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/go-tests.yml b/.github/workflows/go-tests.yml index 142a3df4e09..08cd0aa8a87 100644 --- a/.github/workflows/go-tests.yml +++ b/.github/workflows/go-tests.yml @@ -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