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 dc2c67a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 60 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/check-markdown-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,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 Task
uses: arduino/setup-task@v2
Expand Down
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
62 changes: 11 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,15 @@ 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
pr_comment: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository }}
lint: ${{ github.event_name == 'pull_request' }}
format: ${{ github.event_name == 'pull_request' }}
breaking: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'buf skip breaking') }}
breaking_against: ".git#branch=origin/master,subdir=rpc"
5 changes: 2 additions & 3 deletions .github/workflows/deploy-cobra-mkdocs-versioned-poetry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,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

0 comments on commit dc2c67a

Please sign in to comment.