chore: use buf ci (#11071)

* use buf ci

* check breakage against target branch

* test proto

* fix repo

* setinput

* undo proto change

* minor change

* test without subdir

* addback subdir

* try without input

* proto change

* fix ci

* remove head

* add proto

* add back

* add .git

* test

* test++

* test+++

* something

* something

* something++

* test

* test

* do different design

* revert proto change

* docs

* revert comment
This commit is contained in:
Marko 2022-02-01 22:25:53 +01:00 committed by GitHub
parent df36a6fe5f
commit ab9545527d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 16 deletions

21
.github/workflows/proto-registry.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Buf-Push
# Protobuf runs buf (https://buf.build/) push updated proto files to https://buf.build/cosmos/cosmos-sdk
# This workflow is only run when a .proto file has been changed
on:
push:
branches:
- master
paths:
- 'proto/**'
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v0.6.0
- uses: bufbuild/buf-push-action@v1
with:
input: 'proto'
buf_token: ${{ secrets.BUF_TOKEN }}

View File

@ -3,28 +3,31 @@ name: Protobuf
# This workflow is only run when a .proto file has been changed
on:
pull_request:
paths:
- 'proto/**'
push:
branches:
- master
paths:
- 'proto/**'
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@master
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
**/**.proto
- name: lint
run: make proto-lint
if: env.GIT_DIFF
breakage:
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v0.6.0
- uses: bufbuild/buf-lint-action@v1
with:
input: 'proto'
break-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: technote-space/get-diff-action@v6.0.1
- uses: actions/checkout@v2
- uses: bufbuild/buf-setup-action@v0.6.0
- uses: bufbuild/buf-breaking-action@v1
with:
PATTERNS: |
**/**.proto
- name: check-breakage
run: make proto-check-breaking
if: env.GIT_DIFF
input: 'proto'
against: 'https://github.com/${{ github.repository }}.git#branch=${{ github.event.pull_request.base.ref }},ref=HEAD~1,subdir=proto'