From 0615dfdd9c17a819637d28695bf6ba10a24a1d0a Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Mon, 19 Aug 2024 09:40:01 -0400 Subject: [PATCH 1/2] Install buf with go --- .github/workflows/e2e.yml | 3 --- .github/workflows/linter.yml | 3 --- scripts/lint.sh | 1 + scripts/versions.sh | 3 +++ 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index b98c1803..5b77e647 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -49,8 +49,5 @@ jobs: with: submodules: recursive - - name: Install buf - uses: bufbuild/buf-setup-action@v1.36.0 - - name: Run E2E Tests run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/e2e_test.sh diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index e1b858bb..52f4dc54 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -27,9 +27,6 @@ jobs: with: go-version-file: 'go.mod' - - name: Install buf - uses: bufbuild/buf-setup-action@v1.36.0 - - name: Run Lint run: ./scripts/lint.sh --go-lint diff --git a/scripts/lint.sh b/scripts/lint.sh index 7321e833..ce4a7404 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -16,4 +16,5 @@ source $RELAYER_PATH/scripts/versions.sh go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} golangci-lint run --config=$RELAYER_PATH/.golangci.yml --build-tags=testing ./... --timeout 5m +go install github.com/bufbuild/buf/cmd/${BUF_VERSION} (cd proto && buf lint) diff --git a/scripts/versions.sh b/scripts/versions.sh index 7e087031..641974a9 100755 --- a/scripts/versions.sh +++ b/scripts/versions.sh @@ -26,3 +26,6 @@ SUBNET_EVM_VERSION=${SUBNET_EVM_VERSION:-update-avago-teleporter} # Set golangci-lint version GOLANGCI_LINT_VERSION=${GOLANGCI_LINT_VERSION:-'v1.60'} + +# Set buf version +BUF_VERSION=${BUF_VERSION:-'v1.37.0'} From ba83590c681cf768ae36ffddf7dcada916573202 Mon Sep 17 00:00:00 2001 From: Geoff Stuart Date: Tue, 20 Aug 2024 13:36:19 -0300 Subject: [PATCH 2/2] install in both places --- scripts/lint.sh | 2 +- scripts/protobuf_codegen.sh | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/scripts/lint.sh b/scripts/lint.sh index ce4a7404..90dc5b5b 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -16,5 +16,5 @@ source $RELAYER_PATH/scripts/versions.sh go install -v github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION} golangci-lint run --config=$RELAYER_PATH/.golangci.yml --build-tags=testing ./... --timeout 5m -go install github.com/bufbuild/buf/cmd/${BUF_VERSION} +go install -v github.com/bufbuild/buf/cmd/buf@${BUF_VERSION} (cd proto && buf lint) diff --git a/scripts/protobuf_codegen.sh b/scripts/protobuf_codegen.sh index f4890126..7ba13363 100755 --- a/scripts/protobuf_codegen.sh +++ b/scripts/protobuf_codegen.sh @@ -14,12 +14,7 @@ RELAYER_PATH=$( source $RELAYER_PATH/scripts/versions.sh -## ensure the correct version of "buf" is installed -BUF_VERSION='1.36.0' -if [[ $(buf --version | cut -f2 -d' ') != "${BUF_VERSION}" ]]; then - echo "could not find buf ${BUF_VERSION}, is it installed + in PATH?" - exit 255 -fi +go install -v github.com/bufbuild/buf/cmd/buf@${BUF_VERSION} ## install "protoc-gen-go" PROTOC_GEN_GO_VERSION=$(getDepVersion google.golang.org/protobuf)