-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(composer): generate pb.go using generate step
- Loading branch information
Showing
4 changed files
with
44 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Ensure all `go generate` files are committed | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
generated-committed: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: 'privacy-profile-composer/go.mod' | ||
- uses: arduino/setup-protoc@v3 | ||
with: | ||
version: "25.x" | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
- run: | | ||
go mod download | ||
go install google.golang.org/protobuf/cmd/protoc-gen-go | ||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc | ||
go generate ./... | ||
working-directory: ./privacy-profile-composer | ||
- run: | | ||
changes=$(git status --untracked-files=no --porcelain) | ||
if [[ -n "$changes" ]]; then | ||
echo "=== DETECTED CHANGES ===" | ||
echo "$changes" | ||
git diff | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
FROM golang:1.20 as builder | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y protobuf-compiler \ | ||
&& go install google.golang.org/protobuf/cmd/[email protected] \ | ||
&& go install google.golang.org/grpc/cmd/[email protected] | ||
|
||
WORKDIR /app | ||
|
||
COPY ./privacy-profile-composer/go.mod ./privacy-profile-composer/go.sum ./ | ||
RUN go mod download | ||
|
||
COPY ./privacy-profile-composer/ ./ | ||
RUN make build-envoy-filter | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,5 @@ | ||
build-envoy-filter: proto | ||
build-envoy-filter: | ||
go build -o dist/simple.so -buildmode=c-shared ./cmd/envoy-filter | ||
|
||
run-server: proto | ||
run-server: | ||
go run ./cmd/opa-composer-server --policy_file ./pkg/opa/policy-and-logic/policy.rego | ||
|
||
proto: | ||
protoc \ | ||
--go_out=. --go_opt=module=privacy-profile-composer \ | ||
--go-grpc_out=. --go-grpc_opt=module=privacy-profile-composer \ | ||
./pkg/proto/privacy_profiles.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//go:build generate | ||
// +build generate | ||
|
||
package proto | ||
|
||
//go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./privacy_profiles.proto |