Update CI to generate protobuf and Ent ORM files
- 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:
54
.github/workflows/ci.yml
vendored
54
.github/workflows/ci.yml
vendored
@@ -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: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo 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: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo 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: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo 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
|
||||||
|
|||||||
Reference in New Issue
Block a user