315027ab0d
- .gitea/workflows/ci.yml: lint, race tests (e2e excluded), and govulncheck on push to main and PRs; shared composite action installs protoc + pinned protoc-gen-go/protoc-gen-go-grpc and generates the (gitignored) protobuf code before each Go job. - .golangci.yml (v2 schema): govet, staticcheck, errcheck, ineffassign, unused, misspell, gosec, revive; generated api/grpc/pb excluded. - Makefile: vuln target (govulncheck) added and chained into qa. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
38 lines
1.5 KiB
YAML
38 lines
1.5 KiB
YAML
name: Generate protobuf code
|
|
description: >
|
|
Installs protoc and the pinned protoc-gen-go / protoc-gen-go-grpc plugins,
|
|
then runs `make proto-gen`. api/grpc/pb/ is gitignored (see .gitignore) and
|
|
regenerated at build time (mirrors what the Dockerfile does for image
|
|
builds), so any job that compiles Go code needs this step first or
|
|
`github.com/igodwin/notifier/api/grpc/pb` won't resolve.
|
|
#
|
|
# Local composite action, referenced from ci.yml via:
|
|
# uses: ./.gitea/actions/generate-proto
|
|
# Gitea Actions supports local composite actions the same way GitHub Actions
|
|
# does. Must run after a Go toolchain is on PATH (i.e. after actions/setup-go).
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Install protoc
|
|
shell: bash
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends protobuf-compiler
|
|
protoc --version
|
|
|
|
# Pinned exactly to the versions this module already depends on
|
|
# (google.golang.org/protobuf in go.mod, and the matching
|
|
# protoc-gen-go-grpc release) - deliberately not @latest, so CI can't
|
|
# drift out from under the checked-in go.mod without review.
|
|
- name: Install protoc-gen-go / protoc-gen-go-grpc (pinned)
|
|
shell: bash
|
|
run: |
|
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.36.10
|
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.5.1
|
|
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
|
|
|
|
- name: Generate protobuf code (make proto-gen)
|
|
shell: bash
|
|
run: make proto-gen
|