Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: introduce proto breakage detector #2671

Merged
merged 5 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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