Skip to content

Commit

Permalink
Merge pull request #41 from kzys/gha
Browse files Browse the repository at this point in the history
Run protobuild on GitHub Actions
  • Loading branch information
dmcgowan authored Sep 10, 2021
2 parents a4386c8 + 5dc449d commit 1beadfd
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 71 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,24 @@ jobs:
working-directory: src/github.com/containerd/protobuild
run: |
go build .
- name: Install protoc
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.5.0/protoc-3.5.0-linux-x86_64.zip
sudo unzip -x protoc-3.5.0-linux-x86_64.zip -d /usr/local
sudo chmod -R go+rX /usr/local/include
sudo chmod go+x /usr/local/bin/protoc
# Both google.golang.org/protobuf/cmd/protoc-gen-go and github.com/golang/protobuf/protoc-gen-go > 1.4.0 don't
# support import_path. So this step has to use 1.3.x here.
- name: Install protoc-gen-go
run: |
go install github.com/golang/protobuf/[email protected]
- name: Run protobuild to see all committed auto-generated files can be generated as is
working-directory: src/github.com/containerd/protobuild
run: |
find examples/ -name '*.pb.*' | xargs rm
export PATH=$(go env GOBIN):$PATH
go list ./... | grep -v vendor | xargs ./protobuild
git diff --exit-code
10 changes: 5 additions & 5 deletions Protobuild.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ plugins = ["grpc"]
# For this example, if there were a package that needed this overrides applied,
# you would need to specify that explicitly in the prefixes list. This allows
# one to granularly select which packages have the overrides.
prefixes = ["github.com/stevvooe/protobuild/examples/nogrpc"]
prefixes = ["github.com/containerd/protobuild/examples/nogrpc"]

# Generator allows one to override the generator for the given prefix.
# generator = ""
Expand Down Expand Up @@ -108,13 +108,13 @@ plugins = []
# to stabilize.
#
# For example, if the files are imported as
# github.com/stevvooe/protobuild/examples/foo/foo.proto, and you want to
# github.com/containerd/protobuild/examples/foo/foo.proto, and you want to
# stabilize everything in package "foo", it should be
# "github.com/stevvooe/protobuild/example/foo".
# "github.com/containerd/protobuild/example/foo".
#
# The example below stablizes the protobufs under the examples directory. The
# generated descriptor file will include both the "foo" and "bar" subpackages.
prefix = "github.com/stevvooe/protobuild/examples"
prefix = "github.com/containerd/protobuild/examples"

# Target defines the output location of the merged descriptor file.
target = "examples/next.pb.txt"
Expand All @@ -141,4 +141,4 @@ target = "examples/next.pb.txt"
# Uncomment these lines to try it out!
# [[descriptors]]
# target = "examples/foo/descriptors.pb.txt"
# prefix = "github.com/stevvooe/protobuild/examples/foo"
# prefix = "github.com/containerd/protobuild/examples/foo"
42 changes: 21 additions & 21 deletions examples/bar/bar.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/bar/bar.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package protobuild.example.bar;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/stevvooe/protobuild/examples/bar/;bar";
option go_package = "github.com/containerd/protobuild/examples/bar/;bar";

service Bar {
rpc Do(DoRequest) returns (google.protobuf.Empty);
Expand Down
42 changes: 21 additions & 21 deletions examples/foo/foo.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/foo/foo.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package protobuild.example.foo;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

option go_package = "github.com/stevvooe/protobuild/examples/foo/;foo";
option go_package = "github.com/containerd/protobuild/examples/foo/;foo";

service Foo {
rpc Do(DoRequest) returns (google.protobuf.Empty);
Expand Down
12 changes: 6 additions & 6 deletions examples/next.pb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ file {
syntax: "proto3"
}
file {
name: "github.com/stevvooe/protobuild/examples/bar/bar.proto"
name: "github.com/containerd/protobuild/examples/bar/bar.proto"
package: "protobuild.example.bar"
dependency: "google/protobuf/empty.proto"
dependency: "google/protobuf/timestamp.proto"
Expand All @@ -71,12 +71,12 @@ file {
}
}
options {
go_package: "github.com/stevvooe/protobuild/examples/bar/;bar"
go_package: "github.com/containerd/protobuild/examples/bar/;bar"
}
syntax: "proto3"
}
file {
name: "github.com/stevvooe/protobuild/examples/foo/foo.proto"
name: "github.com/containerd/protobuild/examples/foo/foo.proto"
package: "protobuild.example.foo"
dependency: "google/protobuf/empty.proto"
dependency: "google/protobuf/timestamp.proto"
Expand All @@ -100,12 +100,12 @@ file {
}
}
options {
go_package: "github.com/stevvooe/protobuild/examples/foo/;foo"
go_package: "github.com/containerd/protobuild/examples/foo/;foo"
}
syntax: "proto3"
}
file {
name: "github.com/stevvooe/protobuild/examples/nogrpc/nogrpc.proto"
name: "github.com/containerd/protobuild/examples/nogrpc/nogrpc.proto"
package: "protobuild.example.nogrpc"
dependency: "google/protobuf/timestamp.proto"
message_type {
Expand All @@ -120,7 +120,7 @@ file {
}
}
options {
go_package: "github.com/stevvooe/protobuild/examples/nogrpc/;nogrpc"
go_package: "github.com/containerd/protobuild/examples/nogrpc/;nogrpc"
}
syntax: "proto3"
}
31 changes: 16 additions & 15 deletions examples/nogrpc/nogrpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/nogrpc/nogrpc.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package protobuild.example.nogrpc;

import "google/protobuf/timestamp.proto";

option go_package = "github.com/stevvooe/protobuild/examples/nogrpc/;nogrpc";
option go_package = "github.com/containerd/protobuild/examples/nogrpc/;nogrpc";

message Thing {
google.protobuf.Timestamp timestamp = 3;
Expand Down

0 comments on commit 1beadfd

Please sign in to comment.