diff --git a/.github/mergify.yml b/.github/mergify.yml index d3cc1b0..1a093ba 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -1,7 +1,41 @@ +misc: + - branch: &BRANCHES + # In this pull request, the changes are based on the master branch + - &MASTER_BRANCH base=master + # In this pull request, the changes are based on the 2.x(or 2.x.x) branch + - &2X_BRANCH base~=^2(\.\d+){1,2}$ + pull_request_rules: + - name: Add needs-dco label when DCO check failed + conditions: + # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES + - or: *BRANCHES + - -status-success=DCO + actions: + label: + remove: + - dco-passed + add: + - needs-dco + comment: + message: | + @{{author}} Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco. + + - name: Add dco-passed label when DCO check passed + conditions: + # branch condition: in this pull request, the changes are based on any branch referenced by BRANCHES + - or: *BRANCHES + - status-success=DCO + actions: + label: + remove: + - needs-dco + add: + - dco-passed + - name: Test passed for code changed conditions: - - base=master + - or: *BRANCHES - "status-success=Build and test AMD64 Ubuntu 20.04" - "status-success=Build and test AMD64 Ubuntu 22.04" - "status-success=Build and test AMD64 Fedora 38" @@ -15,7 +49,7 @@ pull_request_rules: - name: Remove ci-passed when build failed conditions: - - base=master + - or: *BRANCHES - or: - "check-failure=Build and test AMD64 Ubuntu 20.04" - "check-failure=Build and test AMD64 Ubuntu 22.04" @@ -30,14 +64,12 @@ pull_request_rules: - name: Add ci-passed when no code changes conditions: - - base=master + - or: *BRANCHES - or: # all path not in source pattern # try keep same as in .github/workflows/main.yaml - and: - - -files~=^(cmake|examples|scripts|src|test|thirdparty)\/.*$ - - -files~=^\.github\/workflows\/main.yaml$ - - -files~=^\.clang-(tidy|format)$ + - -files~=^(cmake|examples|doc/thirdparty)\/.*$ # only .md files changed - -files~=^.*(?) +set(Protobuf_PROTOC_EXECUTABLE $) message(STATUS "using protoc: ${Protobuf_PROTOC_EXECUTABLE}") # resolve grpc_cpp_plugin -set(GRPC_CPP_PLUGIN $) +set(GRPC_CPP_PLUGIN $) message(STATUS "using grpc_cpp_plugin: ${GRPC_CPP_PLUGIN}") diff --git a/cmake/ThirdPartyPackages.cmake b/cmake/ThirdPartyPackages.cmake index ab9c619..fefd8c8 100644 --- a/cmake/ThirdPartyPackages.cmake +++ b/cmake/ThirdPartyPackages.cmake @@ -21,12 +21,15 @@ include(FetchContent) set(GRPC_VERSION 1.49.1) set(NLOHMANN_JSON_VERSION 3.11.3) set(GOOGLETEST_VERSION 1.12.1) +Set(FETCHCONTENT_QUIET FALSE) # grpc FetchContent_Declare( grpc GIT_REPOSITORY https://github.com/grpc/grpc.git GIT_TAG v${GRPC_VERSION} + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE ) # nlohmann_json @@ -34,6 +37,8 @@ FetchContent_Declare( nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json.git GIT_TAG v${NLOHMANN_JSON_VERSION} + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE ) # googletest @@ -41,12 +46,15 @@ FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG release-${GOOGLETEST_VERSION} + GIT_SHALLOW TRUE + GIT_PROGRESS TRUE ) # grpc -if ("${MILVUS_WITH_GRPC}" STREQUAL "pakcage") - find_package(grpc REQUIRED) +if ("${MILVUS_WITH_GRPC}" STREQUAL "package") + find_package(Protobuf REQUIRED) + find_package(gRPC REQUIRED) else () if (WIN32) set(OPENSSL_NO_ASM_TXT "YES") @@ -66,6 +74,7 @@ else () set(ABSL_PROPAGATE_CXX_STD ON CACHE INTERNAL "") add_subdirectory(${grpc_SOURCE_DIR} ${grpc_BINARY_DIR} EXCLUDE_FROM_ALL) add_library(gRPC::grpc++ ALIAS grpc++) + add_executable(gRPC::grpc_cpp_plugin ALIAS grpc_cpp_plugin) endif () endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5f18c37..e7a9800 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -19,7 +19,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src/impl) include_directories(${milvus_proto_BINARY_DIR}) # resolve gtest -if ("${MILVUS_WITH_GTEST}" STREQUAL "pakcage") +if ("${MILVUS_WITH_GTEST}" STREQUAL "package") find_package(GTest REQUIRED) else () if (NOT googletest_POPULATED)