mirror of
https://github.com/0glabs/0g-chain.git
synced 2024-12-25 07:45:18 +00:00
Update proto breaking CI check to pass on release branches (#1407)
* modify proto check breaking to check against the previous commit by default * add additional proto breaking check for pull requests to master * always check proto breaking against target branch when making a pull request
This commit is contained in:
parent
cf009647e6
commit
a4de1b7fb7
5
.github/workflows/proto.yml
vendored
5
.github/workflows/proto.yml
vendored
@ -1,7 +1,8 @@
|
||||
name: Protobuf Checks
|
||||
|
||||
on:
|
||||
push
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
check-proto:
|
||||
@ -19,6 +20,8 @@ jobs:
|
||||
- run: make check-proto-lint
|
||||
- run: make check-proto-format
|
||||
- run: make check-proto-breaking-remote
|
||||
- run: BUF_CHECK_BREAKING_AGAINST="branch=$GITHUB_BASE_REF" make check-proto-breaking-remote
|
||||
if: github.event_name == 'pull_request'
|
||||
- run: make check-proto-gen
|
||||
- run: make check-proto-gen-doc
|
||||
- run: make check-proto-gen-swagger
|
||||
|
@ -43,15 +43,17 @@ proto-format: install-build-deps
|
||||
check-proto-format: proto-format
|
||||
@git diff --exit-code proto/**/*.proto > /dev/null || (echo "Protobuf format is not up to date! Please run \`make proto-format\`."; exit 1)
|
||||
|
||||
BUF_CHECK_BREAKING_AGAINST ?= ref=HEAD~1
|
||||
|
||||
.PHONY: check-proto-breaking
|
||||
check-proto-breaking: install-build-deps
|
||||
@echo "Checking for proto backward compatibility"
|
||||
@$(BUF) breaking --against '.git#branch=master'
|
||||
@$(BUF) breaking --against '.git#$(BUF_CHECK_BREAKING_AGAINST)'
|
||||
|
||||
.PHONY: check-proto-breaking-remote
|
||||
check-proto-breaking-remote: install-build-deps
|
||||
@echo "Checking for proto backward compatibility"
|
||||
@$(BUF) breaking --against '$(HTTPS_GIT)#branch=master'
|
||||
@$(BUF) breaking --against '$(HTTPS_GIT)#$(BUF_CHECK_BREAKING_AGAINST)'
|
||||
|
||||
.PHONY: proto-gen-all
|
||||
proto-gen-all: proto-gen proto-gen-doc proto-gen-swagger
|
||||
|
Loading…
Reference in New Issue
Block a user