Skip to content

Commit

Permalink
build(ci): Add buf generate and dirty check to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pdf committed Mar 9, 2024
1 parent 384d83e commit 488dd89
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '^1.21.5'
cache: false
- name: golangci-lint
- name: Lint
uses: golangci/golangci-lint-action@v4
with:
# Require: The version of golangci-lint to use.
Expand Down Expand Up @@ -51,4 +53,10 @@ jobs:
# skip-build-cache: true

# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"
# install-mode: "goinstall"
- name: Setup buf
uses: bufbuild/[email protected]
- name: Go generate
run: go generate ./...
- name: Check outdated protobuf
run: '[ "$(git status --porcelain | wc -l)" -ne 0 ] && exit 1'
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '^1.21.5'
Expand All @@ -28,6 +28,12 @@ jobs:
uses: golangci/golangci-lint-action@v4
with:
version: v1.54
- name: Setup buf
uses: bufbuild/[email protected]
- name: Go generate
run: go generate ./...
- name: Check outdated protobuf
run: '[ "$(git status --porcelain | wc -l)" -ne 0 ] && exit 1'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
Expand Down
4 changes: 4 additions & 0 deletions proto/proto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
//go:generate buf generate

// Package proto is for codegen only
package proto

0 comments on commit 488dd89

Please sign in to comment.