Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup: Generate proto with go generate only if proto tag is provided #411

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ jobs:
run: |
set -eu
go run -tags pam_binary_cli ./pam login --exec-debug
- name: Generate Proto files
run: |
set -eu
find -name "*.pb.go" -delete -print
go generate -x -tags proto ./...
find -name "*.pb.go"
- name: Generate PAM module
run: |
set -eu
Expand Down
2 changes: 1 addition & 1 deletion generate.go → generate_proto.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build generate
//go:build generate && proto

//go:generate tools/generate-proto.sh --with-grpc authd.proto

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build generate
//go:build generate && proto

//go:generate ../../../../tools/generate-proto.sh --with-grpc grpctestservice.proto

Expand Down
5 changes: 5 additions & 0 deletions pam/internal/gdm/generate_proto.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//go:build generate && proto

//go:generate ../../../tools/generate-proto.sh -I../../.. -I../proto gdm.proto

package gdm
2 changes: 0 additions & 2 deletions pam/internal/gdm/protocol.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:generate ../../../tools/generate-proto.sh -I../../.. -I../proto gdm.proto

// Package gdm is the package for the GDM pam module handing.
package gdm

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build generate
//go:build generate && proto

//go:generate ../../../tools/generate-proto.sh pam.proto

Expand Down
2 changes: 1 addition & 1 deletion tools/generate-proto.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

if [ -v DEB_HOST_GNU_TYPE ]; then
echo "Proto files should not be regenerated during package building"
exit 0
exit 1
fi

# TODO: Watch https://github.com/protocolbuffers/protobuf for any changes on the
Expand Down
Loading