build: simplify the proto generated check in CI (#8617)

Since we now use buf from a tools dependency, we can use the Go tool to install
the version we expected without having to curl a tarball.
This commit is contained in:
M. J. Fromberger
2022-05-26 09:04:52 -07:00
committed by GitHub
parent a3a06cd1a6
commit eb3b488761
2 changed files with 3 additions and 11 deletions

View File

@@ -57,11 +57,7 @@ jobs:
export PATH="${PATH}:${tools}/bin"
export GOBIN="${tools}/bin"
readonly base='https://github.com/bufbuild/buf/releases/latest/download'
readonly OS="$(uname -s)" ARCH="$(uname -m)"
curl -sSL "${base}/buf-${OS}-${ARCH}.tar.gz" \
| tar -xzf - -C "$tools" --strip-components=1
go install github.com/bufbuild/buf/cmd/buf
go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest
make proto-gen

View File

@@ -11,13 +11,9 @@ cd "$(git rev-parse --show-toplevel)"
# Run inside Docker to install the correct versions of the required tools
# without polluting the local system.
docker run --rm -i -v "$PWD":/w --workdir=/w golang:1.18-alpine sh <<"EOF"
apk add curl git make
readonly buf_release='https://github.com/bufbuild/buf/releases/latest/download'
readonly OS="$(uname -s)" ARCH="$(uname -m)"
curl -sSL "${buf_release}/buf-${OS}-${ARCH}.tar.gz" \
| tar -xzf - -C /usr/local --strip-components=1
apk add git make
go install github.com/bufbuild/buf/cmd/buf
go install github.com/gogo/protobuf/protoc-gen-gogofaster@latest
make proto-gen
EOF