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

Add grpcstar_binary rule #23

Merged
merged 8 commits into from
Jun 14, 2023
Merged
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
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.1
6.2.1
11 changes: 11 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,14 @@ jobs:
--bazelrc=.bazelrc
test
...

- name: bazel run
env:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: >-
bazel
--bazelrc=.github/workflows/ci.bazelrc
--bazelrc=.bazelrc
run
//example/routeguide:server
19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
BAZEL=bzl

.PHONY: build
build:
bazel build ...
$(BAZEL) build ...

.PHONY: test
test:
bazel test ... --runs_per_test=30
$(BAZEL) test ... --runs_per_test=30

.PHONY: tidy
tidy:
go mod tidy
bazel run update_go_repositories
bazel run gazelle
$(BAZEL) run update_go_repositories
$(BAZEL) run gazelle

golden:
bazel run //cmd/grpcstar:grpcstar_test \
$(BAZEL) run //cmd/grpcstar:grpcstar_test \
--action_env=NOGODEBUG=http2debug=2 \
-- \
--update

.PHONY: serve
serve: build
GODEBUG=http2debug=2 \
bazel-bin/cmd/grpcstar/grpcstar_/grpcstar \
-p bazel-bin/example/routeguide/routeguide_proto_descriptor.pb \
-f cmd/grpcstar/testdata/routeguide.grpc.star

.PHONY: routeguide_proto_descriptor
routeguide_proto_descriptor:
bazel build //example/routeguide:routeguide_proto_descriptor
$(BAZEL) build //example/routeguide:routeguide_proto_descriptor
cp -f bazel-bin/example/routeguide/routeguide_proto_descriptor.pb pkg/starlarkgrpc/
cp -f bazel-bin/example/routeguide/routeguide_proto_descriptor.pb pkg/protodescriptorset/

.PHONY: plugin_proto_descriptor
plugin_proto_descriptor:
bazel build @protoapis//google/protobuf/compiler:plugin_descriptor
$(BAZEL) build @protoapis//google/protobuf/compiler:plugin_descriptor
cp -f bazel-bin/external/protoapis/google/protobuf/compiler/plugin_descriptor.pb cmd/protoc-gen-starlark

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,10 @@ The `net` module contains network-related functions.
- `net.Listener` constructs a new listener via the
[net.Listen](https://pkg.go.dev/net#Listen) func.


## process

The `process` module contains subprocess-related functions.

- `process.run` runs a subprocess.

1 change: 0 additions & 1 deletion cmd/grpcstar/grpcstar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func TestGoldens(t *testing.T) {
os.Stderr = stdout
os.Stderr = stderr
}()

if err := run(".", []string{
"-protoset=../../example/routeguide/routeguide_proto_descriptor.pb",
"-file=" + filepath.Join("testdata", pair.file),
Expand Down
298 changes: 0 additions & 298 deletions cmd/grpcstar/testdata/tls.grpc.star

This file was deleted.

6 changes: 0 additions & 6 deletions cmd/grpcstar/testdata/tls.grpc.star.err

This file was deleted.

Empty file.
Loading