Update CI to generate protobuf and Ent ORM files
Some checks failed
CI / Build (pull_request) Failing after 3s
CI / Format Check (pull_request) Failing after 1s
CI / Test (pull_request) Failing after 5s
CI / Lint (pull_request) Failing after 2s

- Add protoc installation step in all CI jobs (test, lint, build)
- Install protoc-gen-go and protoc-gen-go-grpc plugins
- Generate protobuf files using 'make generate-proto' before building/testing
- Generate Ent ORM files from ent/ directory before building/testing
- Ensures CI works correctly after removing generated files from git tracking
This commit is contained in:
2025-11-06 22:25:30 +01:00
parent bbd4909fc8
commit 46255bb1a2

View File

@@ -33,6 +33,23 @@ jobs:
- name: Verify dependencies - name: Verify dependencies
run: go mod verify run: go mod verify
- name: Install protoc and plugins
run: |
apt-get update
apt-get install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- name: Generate protobuf files
run: make generate-proto
- name: Generate Ent ORM files
run: |
go install entgo.io/ent/cmd/ent@latest
if [ -d "ent" ] && [ -f "ent/generate.go" ]; then
cd ent && go generate ./...
fi
- name: Check for test files - name: Check for test files
id: check-tests id: check-tests
run: | run: |
@@ -78,6 +95,26 @@ jobs:
with: with:
go-version: '1.25.3' go-version: '1.25.3'
- name: Download dependencies
run: go mod download
- name: Install protoc and plugins
run: |
apt-get update
apt-get install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- name: Generate protobuf files
run: make generate-proto
- name: Generate Ent ORM files
run: |
go install entgo.io/ent/cmd/ent@latest
if [ -d "ent" ] && [ -f "ent/generate.go" ]; then
cd ent && go generate ./...
fi
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v7 uses: golangci/golangci-lint-action@v7
with: with:
@@ -107,6 +144,23 @@ jobs:
- name: Download dependencies - name: Download dependencies
run: go mod download run: go mod download
- name: Install protoc and plugins
run: |
apt-get update
apt-get install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
- name: Generate protobuf files
run: make generate-proto
- name: Generate Ent ORM files
run: |
go install entgo.io/ent/cmd/ent@latest
if [ -d "ent" ] && [ -f "ent/generate.go" ]; then
cd ent && go generate ./...
fi
- name: Build - name: Build
run: | run: |
go build -v -o bin/platform ./cmd/platform go build -v -o bin/platform ./cmd/platform