diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7ea48e8226..2fb1d11989 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -76,7 +76,7 @@ jobs: docker-compose up -d pulsar etcd minio - name: Build and UnitTest run: | - ./build/builder.sh /bin/bash -c "make check-proto-product && make codecov" + ./build/builder.sh /bin/bash -c "make ci-ut" - name: Get the status & restart count for containers when ut failed if: ${{ failure() }} run: | diff --git a/Makefile b/Makefile index 62fdd5d27f..33da871f1d 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ ARCH := $(shell arch) mode = Release disk_index = OFF + export GIT_BRANCH=master milvus: build-cpp print-build-info @@ -46,14 +47,19 @@ tools/bin/revive: tools/check/go.mod cppcheck: @(env bash ${PWD}/scripts/core_build.sh -l) -generated-proto-go: export protoc:=${PWD}/cmake_build/thirdparty/protobuf/protobuf-build/protoc -generated-proto-go: build-cpp +# put generate proto as a separated target because build cpp have different cases like with unittest. +generated-proto-go-without-cpp: export protoc:=${PWD}/cmake_build/thirdparty/protobuf/protobuf-build/protoc +generated-proto-go-without-cpp: @mkdir -p ${GOPATH}/bin @which protoc-gen-go 1>/dev/null || (echo "Installing protoc-gen-go" && cd /tmp && go install github.com/golang/protobuf/protoc-gen-go@v1.3.2) @(env bash $(PWD)/scripts/proto_gen_go.sh) -check-proto-product: generated-proto-go - @(env bash $(PWD)/scripts/check_proto_product.sh) +generated-proto-go: build-cpp generated-proto-go-without-cpp + +check-proto-product-only: + @(env bash $(PWD)/scripts/check_proto_product.sh) +check-proto-product: generated-proto-go check-proto-product-only + fmt: ifdef GO_DIFF_FILES @@ -289,3 +295,6 @@ mock-datanode: mock-tnx-kv: mockery --name=TxnKV --dir=$(PWD)/internal/kv --output=$(PWD)/internal/kv/mocks --filename=TxnKV.go --with-expecter + + +ci-ut: build-cpp-with-coverage generated-proto-go-without-cpp codecov-cpp codecov-go