Skip to content

Commit a411b05

Browse files
authored
chore(ci): DSPX-1424 Enforce minimum buf version (#2641)
### Proposed Changes * Enforce minimum `buf` version ### Checklist - [ ] I have added or updated unit tests - [ ] I have added or updated integration tests (if appropriate) - [ ] I have added or updated documentation ### Testing Instructions
1 parent 15d20b1 commit a411b05

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/workflows/checks.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ jobs:
480480
- uses: bufbuild/buf-setup-action@a47c93e0b1648d5651a065437926377d060baa99 # v1.50.0
481481
with:
482482
github_token: ${{ github.token }}
483+
version: "1.56.0"
483484
- uses: bufbuild/buf-lint-action@06f9dd823d873146471cfaaf108a993fe00e5325 # v1.1.1
484485
with:
485486
input: service

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
MODS=protocol/go lib/ocrypto lib/fixtures lib/flattening lib/identifier sdk service examples
77
HAND_MODS=lib/ocrypto lib/fixtures lib/flattening lib/identifier sdk service examples
8+
REQUIRED_BUF_VERSION=1.56.0
89

910
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
1011

@@ -17,6 +18,12 @@ all: toolcheck clean build lint license test
1718
toolcheck:
1819
@echo "Checking for required tools..."
1920
@which buf > /dev/null || (echo "buf not found, please install it from https://docs.buf.build/installation" && exit 1)
21+
@BUF_VERSION=$$(buf --version | head -n 1 | awk '{print $$1}'); \
22+
if [ "$$(printf '%s\n' '$(REQUIRED_BUF_VERSION)' "$$BUF_VERSION" | sort -V | head -n 1)" != "$(REQUIRED_BUF_VERSION)" ]; then \
23+
echo "Error: buf version $(REQUIRED_BUF_VERSION) or later is required, but found $$BUF_VERSION."; \
24+
echo "Please upgrade buf. See https://docs.buf.build/installation for instructions."; \
25+
exit 1; \
26+
fi
2027
@which golangci-lint > /dev/null || (echo "golangci-lint not found, run 'go install github.com/golangci/golangci-lint/cmd/[email protected]'" && exit 1)
2128
@which protoc-gen-doc > /dev/null || (echo "protoc-gen-doc not found, run 'go install github.com/pseudomuto/protoc-gen-doc/cmd/[email protected]'" && exit 1)
2229
@which protoc-gen-connect-openapi > /dev/null || (echo "protoc-gen-connect-openapi not found, run 'go install github.com/sudorandom/[email protected]'" && exit 1)

0 commit comments

Comments
 (0)