From ab9545527d630fe38761aa61cc5c95eabd68e0e6 Mon Sep 17 00:00:00 2001 From: Marko Date: Tue, 1 Feb 2022 22:25:53 +0100 Subject: [PATCH] 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 --- .github/workflows/proto-registry.yml | 21 +++++++++++++++++ .github/workflows/proto.yml | 35 +++++++++++++++------------- 2 files changed, 40 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/proto-registry.yml diff --git a/.github/workflows/proto-registry.yml b/.github/workflows/proto-registry.yml new file mode 100644 index 0000000000..79cf58e659 --- /dev/null +++ b/.github/workflows/proto-registry.yml @@ -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 }} + diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 1ddbf00976..105c3fb904 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -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'