Skip to content

Commit

Permalink
fix: workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
clement2026 committed Aug 23, 2024
1 parent 29c39c6 commit 6d732f0
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
go-version: '^1.23'

- name: Install protoc-gen-go-grpc
run: go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

- name: Install Protoc
uses: arduino/setup-protoc@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
run_install: false

- name: Install protoc-gen-js
run: pnpm install -g protoc-gen-js
run: pnpm install -g protoc-gen-js protoc-gen-grpc-web

- name: Install Protoc
uses: arduino/setup-protoc@v3
Expand Down
45 changes: 12 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,17 @@
# mode=grpcwebtext prevents client from receiving all the messages at once when using streaming
all: protoc test build

build: protoc build-go build-ts
protoc:
$(MAKE) -C go protoc
$(MAKE) -C ts protoc

protoc: make-dirs
protoc --go_out=./go/api --go_opt=paths=source_relative --go-grpc_out=./go/api --go-grpc_opt=paths=source_relative --proto_path ./proto ./proto/api.proto
protoc -I=./proto api.proto \
--js_out=import_style=commonjs,binary:./ts/components/api \
--grpc-web_out=import_style=typescript,mode=grpcwebtext:./ts/components/api
test:
$(MAKE) -C go test
$(MAKE) -C ts test

build-go:
cd go && go build .

build-ts:
cd ts && pnpm build

test: test-ts test-go

test-go:
cd go && go test ./...

test-ts:
cd ts && pnpm test

install-ts:
cd ts && pnpm install
build:
$(MAKE) -C go build
$(MAKE) -C ts build

clean:
rm -rf ts/out
cd go && go clean

make-dirs:
@if [ ! -d "./go/api" ]; then \
mkdir ./go/api; \
fi
@if [ ! -d "./ts/components/api" ]; then \
mkdir ./ts/components/api; \
fi
$(MAKE) -C go clean
$(MAKE) -C ts clean
16 changes: 16 additions & 0 deletions go/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
all: protoc test build

protoc:
@if [ ! -d "./api" ]; then \
mkdir ./api; \
fi
protoc --go_out=./api --go_opt=paths=source_relative --go-grpc_out=./api --go-grpc_opt=paths=source_relative --proto_path ../proto ../proto/api.proto

build:
go build .

test:
go test ./...

clean:
go clean
24 changes: 24 additions & 0 deletions ts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# mode=grpcwebtext prevents client from receiving all the messages at once when using streaming

build: protoc test build

protoc:
@if [ ! -d "./components/api" ]; then \
mkdir ./components/api; \
fi
protoc -I=../proto api.proto \
--js_out=import_style=commonjs,binary:./components/api \
--grpc-web_out=import_style=typescript,mode=grpcwebtext:./components/api


build:
pnpm build

test:
pnpm test

install:
pnpm install

clean:
rm -rf out

0 comments on commit 6d732f0

Please sign in to comment.