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: makefile target for checking if protos are updated #979

Merged
merged 8 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/automated-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: "1.19" # The Go version to download (if necessary) and use.

- name: Unit, integration and difference tests
run: go test ./...

- name: E2E tests
run: make test-e2e-short
- name: Proto Check
run: make proto-check
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ proto-gen:
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(containerProtoImage) \
sh ./scripts/protocgen.sh; fi

proto-check:
@if git diff --quiet; then \
echo "No files were modified before running 'make proto-gen'."; \
else \
echo "Error: Uncommitted changes exist before running 'make proto-gen'. Please commit or stash your changes."; \
exit 1; \
fi
@$(MAKE) proto-gen
@if git diff --quiet; then \
echo "No files were modified after running 'make proto-gen'. Pass!"; \
else \
echo "Error: Files were modified after running 'make proto-gen'. Please commit changes to .pb files"; \
exit 1; \
fi


proto-format:
@echo "Formatting Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoFmt}$$"; then docker start -a $(containerProtoFmt); else docker run --name $(containerProtoFmt) -v $(CURDIR):/workspace --workdir /workspace tendermintdev/docker-build-proto \
Expand Down