diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c9c7bad9f9a..1e205985d24 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -118,3 +118,63 @@ jobs: shell: bash run: | YDB_VERSION=${{ matrix.ydb-version }} ctest -j2 --preset integration + + test-install: + name: "Test CMake Install" + concurrency: + group: test-install-${{ github.ref }}-${{ matrix.compiler }} + cancel-in-progress: true + strategy: + fail-fast: false + matrix: + compiler: [clang, gcc] + runs-on: ubuntu-22.04 + steps: + - name: Checkout PR + uses: actions/checkout@v4 + if: github.event.pull_request.head.sha != '' + with: + submodules: true + ref: ${{ github.event.pull_request.head.sha }} + + - name: Checkout + uses: actions/checkout@v4 + if: github.event.pull_request.head.sha == '' + with: + submodules: true + + - name: Install dependencies + uses: ./.github/actions/prepare_vm + + - name: Prepare ccache timestamp + id: ccache_cache_timestamp + shell: cmake -P {0} + run: | + string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC) + message("::set-output name=timestamp::${current_date}") + + - name: Restore cache files + uses: actions/cache/restore@v4 + with: + path: ~/.ccache + key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }} + restore-keys: | + ${{ runner.os }}-ccache-${{ matrix.compiler }}- + + - name: Build and Install SDK + shell: bash + run: | + mkdir build + cmake --preset release-${{ matrix.compiler }} -D YDB_SDK_INSTALL=On + cmake --build --preset default + cmake --install build --prefix ./_install + + - name: Verify Installation + shell: bash + run: | + echo "Installation directory content for ${{ matrix.compiler }}:" + ls -R ./_install + if [ -z "$(ls -A ./_install)" ]; then + echo "Error: Installation directory is empty!" + exit 1 + fi \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 41f4783ca2d..5f042831a1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -93,7 +93,6 @@ if (YDB_SDK_INSTALL) ) _ydb_sdk_directory_install(FILES ${YDB_SDK_SOURCE_DIR}/cmake/FindBrotli.cmake - ${YDB_SDK_SOURCE_DIR}/cmake/FindgRPC.cmake ${YDB_SDK_SOURCE_DIR}/cmake/FindIDN.cmake ${YDB_SDK_SOURCE_DIR}/cmake/FindLZ4.cmake ${YDB_SDK_SOURCE_DIR}/cmake/FindxxHash.cmake diff --git a/include/ydb-cpp-sdk/client/iam/common/CMakeLists.txt b/include/ydb-cpp-sdk/client/iam/common/CMakeLists.txt index a3aa3438ef5..8bfe2abd5ed 100644 --- a/include/ydb-cpp-sdk/client/iam/common/CMakeLists.txt +++ b/include/ydb-cpp-sdk/client/iam/common/CMakeLists.txt @@ -8,4 +8,4 @@ target_link_libraries(client-iam-types yutil ) -_ydb_sdk_install_targets(client-iam-types) +_ydb_sdk_install_targets(TARGETS client-iam-types) diff --git a/include/ydb-cpp-sdk/client/iam_private/common/CMakeLists.txt b/include/ydb-cpp-sdk/client/iam_private/common/CMakeLists.txt index 7248fe5131a..bbfac3c9e47 100644 --- a/include/ydb-cpp-sdk/client/iam_private/common/CMakeLists.txt +++ b/include/ydb-cpp-sdk/client/iam_private/common/CMakeLists.txt @@ -5,4 +5,4 @@ target_link_libraries(client-iam_private-types client-iam-types ) -_ydb_sdk_install_targets(client-iam_private-types) +_ydb_sdk_install_targets(TARGETS client-iam_private-types) diff --git a/include/ydb-cpp-sdk/client/topic/CMakeLists.txt b/include/ydb-cpp-sdk/client/topic/CMakeLists.txt index d8cba6d7027..9a6bede21ed 100644 --- a/include/ydb-cpp-sdk/client/topic/CMakeLists.txt +++ b/include/ydb-cpp-sdk/client/topic/CMakeLists.txt @@ -25,3 +25,5 @@ generate_enum_serilization(client-ydb_topic-include INCLUDE_HEADERS include/ydb-cpp-sdk/client/topic/write_events.h ) + +_ydb_sdk_install_targets(TARGETS client-ydb_topic-include) \ No newline at end of file diff --git a/src/client/iam_private/common/CMakeLists.txt b/src/client/iam_private/common/CMakeLists.txt index e9cb00bbc23..add1e6e8c11 100644 --- a/src/client/iam_private/common/CMakeLists.txt +++ b/src/client/iam_private/common/CMakeLists.txt @@ -6,4 +6,4 @@ target_link_libraries(client-iam_private-common client-iam_private-types ) -_ydb_sdk_install_targets(client-iam_private-common) +_ydb_sdk_install_targets(TARGETS client-iam_private-common) diff --git a/src/client/types/credentials/CMakeLists.txt b/src/client/types/credentials/CMakeLists.txt index 1d2fc50cdbc..8c53cb0f8bf 100644 --- a/src/client/types/credentials/CMakeLists.txt +++ b/src/client/types/credentials/CMakeLists.txt @@ -16,5 +16,4 @@ target_sources(client-ydb_types-credentials PRIVATE credentials.cpp ) -_ydb_sdk_install_targets(TARGETS client-ydb_types-credentials) _ydb_sdk_make_client_component(Credentials client-ydb_types-credentials)