Skip to content

Commit

Permalink
feat: generate ttrpc during build
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrox committed Jun 2, 2024
1 parent 1439719 commit 3eb988c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ jobs:
with:
go-version: "1.22"

- uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: protobuf-compiler libprotobuf-dev
version: 1.0

- name: build ebpf image
run: make build-ebpf

- name: generate ebpf
- name: generate ttrpc and ebpf
run: make generate

- name: check for diff
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ CFLAGS := -O2 -g -Wall -Werror
# dependencies installed.
generate: export BPF_CLANG := $(CLANG)
generate: export BPF_CFLAGS := $(CFLAGS)
generate:
generate: ttrpc
docker run --rm -v $(PWD):/app:Z --user $(shell id -u):$(shell id -g) --env=BPF_CLANG="$(CLANG)" --env=BPF_CFLAGS="$(CFLAGS)" $(EBPF_IMAGE)

ttrpc:
go mod download
cd api/shim/v1; protoc --go_out=. --go_opt=paths=source_relative \
--ttrpc_out=. --plugin=protoc-gen-ttrpc=`which protoc-gen-go-ttrpc` \
--ttrpc_opt=paths=source_relative *.proto -I. \
Expand Down

0 comments on commit 3eb988c

Please sign in to comment.