Skip to content

Commit

Permalink
ci: introduce proto breakage detector (#2671)
Browse files Browse the repository at this point in the history
Co-authored-by: Rootul P <rootulp@gmail.com>
  • Loading branch information
cmwaters and rootulp authored Oct 16, 2023
1 parent 2b8cc9e commit 5094399
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/protobuf.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# protobuf runs `make proto-lint` and `make proto-gen`.
name: protobuf
on:
pull_request:
Expand Down Expand Up @@ -32,10 +31,9 @@ jobs:
fi
# yamllint enable

# add this back when we start using versioning
# breakage:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: check-breakage
# run: make proto-check-breaking
proto-check-breaking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: proto-check-breaking
run: make proto-check-breaking
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bu
IMAGE := ghcr.io/tendermint/docker-build-proto:latest
DOCKER_PROTO_BUILDER := docker run -v $(shell pwd):/workspace --workdir /workspace $(IMAGE)
PROJECTNAME=$(shell basename "$(PWD)")
HTTPS_GIT := https://github.com/celestiaorg/celestia-app.git

# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=celestia-app \
Expand Down Expand Up @@ -57,6 +58,12 @@ proto-lint:
@$(DOCKER_BUF) lint --error-format=json
.PHONY: proto-lint

## proto-check-breaking: Check if there are any breaking change to protobuf definitions.
proto-check-breaking:
@echo "--> Checking if Protobuf definitions have any breaking changes"
@$(DOCKER_BUF) breaking --against $(HTTPS_GIT)#branch=v1.x
.PHONY: proto-check-breaking

## proto-format: Format protobuf files. Requires docker.
proto-format:
@echo "--> Formatting Protobuf files"
Expand Down

0 comments on commit 5094399

Please sign in to comment.