diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 433ba0b6..dd23f44b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,6 +36,7 @@ jobs: sudo apt-get update sudo apt-get install build-essential ffmpeg protobuf-compiler ccache upx-ucl gawk sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libgmock-dev + make install-go-tools - name: Install CUDA Dependencies run: | curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/cross-linux-aarch64/cuda-keyring_1.1-1_all.deb @@ -151,6 +152,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y wget curl build-essential ffmpeg protobuf-compiler ccache upx-ucl gawk cmake libgmock-dev + make install-go-tools - name: Intel Dependencies run: | wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null @@ -253,8 +255,7 @@ jobs: - name: Dependencies run: | brew install protobuf grpc - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@8ba23be9613c672d40ae261d2a1335d639bdd59b - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.0 + make install-go-tools - name: Build id: build run: | @@ -295,8 +296,7 @@ jobs: - name: Dependencies run: | brew install protobuf grpc libomp llvm - go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af - go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2 + make install-go-tools - name: Build id: build run: | diff --git a/Makefile b/Makefile index fbdfe285..6eca7ba5 100644 --- a/Makefile +++ b/Makefile @@ -337,8 +337,14 @@ clean-tests: clean-dc: clean cp -r /build/backend-assets /workspace/backend-assets +## Install Go tools +install-go-tools: + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2 + go install github.com/GeertJohan/go.rice/rice@latest + ## Build: -build: prepare backend-assets grpcs ## Build the project +build: prepare backend-assets grpcs install-go-tools ## Build the project $(info ${GREEN}I local-ai build info:${RESET}) $(info ${GREEN}I BUILD_TYPE: ${YELLOW}$(BUILD_TYPE)${RESET}) $(info ${GREEN}I GO_TAGS: ${YELLOW}$(GO_TAGS)${RESET}) @@ -422,10 +428,12 @@ prepare-test: grpcs cp tests/models_fixtures/* test-models ## Build test binary -test-binary: prepare-test +test-binary: prepare-test install-go-tools export GO_TAGS="tts debug" - CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) test -c -o test-binary ./... - rice append --exec test-binary + mkdir -p $(TEST_DIR) + CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) test -c -o $(TEST_DIR)/test-binary ./... + rice append --exec $(TEST_DIR)/test-binary + cp $(TEST_DIR)/test-binary ./test-binary ## Test targets test: prepare test-models/testmodel.ggml test-binary @@ -504,7 +512,7 @@ protogen: protogen-go protogen-python protogen-clean: protogen-go-clean protogen-python-clean .PHONY: protogen-go -protogen-go: +protogen-go: install-go-tools mkdir -p pkg/grpc/proto protoc --experimental_allow_proto3_optional -Ibackend/ --go_out=pkg/grpc/proto/ --go_opt=paths=source_relative --go-grpc_out=pkg/grpc/proto/ --go-grpc_opt=paths=source_relative \ backend/backend.proto