Skip to content

Commit 0e7a197

Browse files
authored
Fix cmake install, add to CI (#555)
1 parent b4d0a39 commit 0e7a197

File tree

7 files changed

+65
-5
lines changed

7 files changed

+65
-5
lines changed

.github/workflows/tests.yaml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,63 @@ jobs:
118118
shell: bash
119119
run: |
120120
YDB_VERSION=${{ matrix.ydb-version }} ctest -j2 --preset integration
121+
122+
test-install:
123+
name: "Test CMake Install"
124+
concurrency:
125+
group: test-install-${{ github.ref }}-${{ matrix.compiler }}
126+
cancel-in-progress: true
127+
strategy:
128+
fail-fast: false
129+
matrix:
130+
compiler: [clang, gcc]
131+
runs-on: ubuntu-22.04
132+
steps:
133+
- name: Checkout PR
134+
uses: actions/checkout@v4
135+
if: github.event.pull_request.head.sha != ''
136+
with:
137+
submodules: true
138+
ref: ${{ github.event.pull_request.head.sha }}
139+
140+
- name: Checkout
141+
uses: actions/checkout@v4
142+
if: github.event.pull_request.head.sha == ''
143+
with:
144+
submodules: true
145+
146+
- name: Install dependencies
147+
uses: ./.github/actions/prepare_vm
148+
149+
- name: Prepare ccache timestamp
150+
id: ccache_cache_timestamp
151+
shell: cmake -P {0}
152+
run: |
153+
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
154+
message("::set-output name=timestamp::${current_date}")
155+
156+
- name: Restore cache files
157+
uses: actions/cache/restore@v4
158+
with:
159+
path: ~/.ccache
160+
key: ${{ runner.os }}-ccache-${{ matrix.compiler }}-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
161+
restore-keys: |
162+
${{ runner.os }}-ccache-${{ matrix.compiler }}-
163+
164+
- name: Build and Install SDK
165+
shell: bash
166+
run: |
167+
mkdir build
168+
cmake --preset release-${{ matrix.compiler }} -D YDB_SDK_INSTALL=On
169+
cmake --build --preset default
170+
cmake --install build --prefix ./_install
171+
172+
- name: Verify Installation
173+
shell: bash
174+
run: |
175+
echo "Installation directory content for ${{ matrix.compiler }}:"
176+
ls -R ./_install
177+
if [ -z "$(ls -A ./_install)" ]; then
178+
echo "Error: Installation directory is empty!"
179+
exit 1
180+
fi

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ if (YDB_SDK_INSTALL)
9393
)
9494
_ydb_sdk_directory_install(FILES
9595
${YDB_SDK_SOURCE_DIR}/cmake/FindBrotli.cmake
96-
${YDB_SDK_SOURCE_DIR}/cmake/FindgRPC.cmake
9796
${YDB_SDK_SOURCE_DIR}/cmake/FindIDN.cmake
9897
${YDB_SDK_SOURCE_DIR}/cmake/FindLZ4.cmake
9998
${YDB_SDK_SOURCE_DIR}/cmake/FindxxHash.cmake

include/ydb-cpp-sdk/client/iam/common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ target_link_libraries(client-iam-types
88
yutil
99
)
1010

11-
_ydb_sdk_install_targets(client-iam-types)
11+
_ydb_sdk_install_targets(TARGETS client-iam-types)

include/ydb-cpp-sdk/client/iam_private/common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ target_link_libraries(client-iam_private-types
55
client-iam-types
66
)
77

8-
_ydb_sdk_install_targets(client-iam_private-types)
8+
_ydb_sdk_install_targets(TARGETS client-iam_private-types)

include/ydb-cpp-sdk/client/topic/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ generate_enum_serilization(client-ydb_topic-include
2525
INCLUDE_HEADERS
2626
include/ydb-cpp-sdk/client/topic/write_events.h
2727
)
28+
29+
_ydb_sdk_install_targets(TARGETS client-ydb_topic-include)

src/client/iam_private/common/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ target_link_libraries(client-iam_private-common
66
client-iam_private-types
77
)
88

9-
_ydb_sdk_install_targets(client-iam_private-common)
9+
_ydb_sdk_install_targets(TARGETS client-iam_private-common)

src/client/types/credentials/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ target_sources(client-ydb_types-credentials PRIVATE
1616
credentials.cpp
1717
)
1818

19-
_ydb_sdk_install_targets(TARGETS client-ydb_types-credentials)
2019
_ydb_sdk_make_client_component(Credentials client-ydb_types-credentials)

0 commit comments

Comments
 (0)