Skip to content

Commit

Permalink
github: update protobuf related actions
Browse files Browse the repository at this point in the history
  • Loading branch information
alessio-perugini committed Oct 18, 2024
1 parent 365cab9 commit 9496a56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 54 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/check-mkdocs-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,9 @@ jobs:
- name: Install Go dependencies
run: go install github.com/pseudomuto/protoc-gen-doc/cmd/[email protected]

- name: Install protoc compiler
uses: arduino/setup-protoc@v3
- uses: bufbuild/buf-action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
setup_only: true

- name: Install Python
uses: actions/setup-python@v5
Expand Down
59 changes: 8 additions & 51 deletions .github/workflows/check-protobuf-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,9 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
- uses: bufbuild/buf-action@v1
with:
go-version: ${{ env.GO_VERSION }}

- name: Install protoc compiler
uses: arduino/setup-protoc@v3
with:
version: v26.1
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Install Go deps
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
setup_only: true

- name: Install Task
uses: arduino/setup-task@v2
Expand All @@ -90,43 +78,12 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Install buf (protoc linter)
# used by the protobuf breaking change detector
- name: Fetch main branch
run: |
go install github.com/bufbuild/buf/cmd/[email protected]
go install github.com/bufbuild/buf/cmd/[email protected]
go install github.com/bufbuild/buf/cmd/[email protected]
- name: Install Task
uses: arduino/setup-task@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Lint protocol buffers
run: task protoc:check
git fetch origin master
check-formatting:
needs: run-determination
if: needs.run-determination.outputs.result == 'true'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Task
uses: arduino/setup-task@v2
- uses: bufbuild/buf-action@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Format protocol buffers
run: task protoc:format

- name: Check formatting
run: git diff --color --exit-code
breaking_against: ".git#branch=origin/master,subdir=rpc"
pr_comment: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}

0 comments on commit 9496a56

Please sign in to comment.