Skip to content

Commit

Permalink
feat conan: test userver package on samples, including testsuite runs
Browse files Browse the repository at this point in the history
Fixes: #816
Tests: протестировано локально и в CI
commit_hash:b80386a30e1aa571c801dca41b04558fe7924058
  • Loading branch information
apolukhin committed Dec 28, 2024
1 parent 571f419 commit b5d3cb3
Show file tree
Hide file tree
Showing 28 changed files with 16 additions and 641 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Install Ubuntu packages
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip python3-venv
sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip python3-venv postgresql
- name: Install MacOS packages
if: matrix.os == 'macos-latest'
Expand All @@ -52,4 +52,13 @@ jobs:
- name: Run conan
run: |
conan create . --build=missing -s:a compiler.cppstd=17 -pr:b=default ${{matrix.conanflags}} -tf conan/test_package/
conan create . --build=missing -s:a compiler.cppstd=17 -pr:b=default ${{matrix.conanflags}}
- name: Test userver conan package
run: |
USERVER_VERSION=$(conan list -c -v quiet userver/* | tail -n 1)
for SAMPLE in hello_service embedded_files postgres_service grpc_service; do
cp scripts/tests/conanfile.py samples/$SAMPLE/
conan test samples/$SAMPLE/ --build=never -s:a compiler.cppstd=17 -pr:b=default ${{matrix.conanflags}} ${USERVER_VERSION}
rm samples/$SAMPLE/conanfile.py
done
24 changes: 0 additions & 24 deletions .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -480,30 +480,6 @@
"cmake/modules/Findmongoc.cmake":"taxi/uservices/userver/cmake/modules/Findmongoc.cmake",
"cmake/sanitize-macos.blacklist.txt":"taxi/uservices/userver/cmake/sanitize-macos.blacklist.txt",
"cmake/sanitize.blacklist.txt":"taxi/uservices/userver/cmake/sanitize.blacklist.txt",
"conan/README.md":"taxi/uservices/userver/conan/README.md",
"conan/test_package/CMakeLists.txt":"taxi/uservices/userver/conan/test_package/CMakeLists.txt",
"conan/test_package/conanfile.py":"taxi/uservices/userver/conan/test_package/conanfile.py",
"conan/test_package/hello.cpp":"taxi/uservices/userver/conan/test_package/hello.cpp",
"conan/test_package/hello.hpp":"taxi/uservices/userver/conan/test_package/hello.hpp",
"conan/test_package/hello_service.cpp":"taxi/uservices/userver/conan/test_package/hello_service.cpp",
"conan/test_package/hello_service/CMakeLists.txt":"taxi/uservices/userver/conan/test_package/hello_service/CMakeLists.txt",
"conan/test_package/hello_service/conftest.py":"taxi/uservices/userver/conan/test_package/hello_service/conftest.py",
"conan/test_package/hello_service/hello_service.cpp":"taxi/uservices/userver/conan/test_package/hello_service/hello_service.cpp",
"conan/test_package/hello_service/static_config.yaml":"taxi/uservices/userver/conan/test_package/hello_service/static_config.yaml",
"conan/test_package/hello_service/test_hello.py":"taxi/uservices/userver/conan/test_package/hello_service/test_hello.py",
"conan/test_package/proto/greeter.proto":"taxi/uservices/userver/conan/test_package/proto/greeter.proto",
"conan/test_package/test_clickhouse.cpp":"taxi/uservices/userver/conan/test_package/test_clickhouse.cpp",
"conan/test_package/test_core.cpp":"taxi/uservices/userver/conan/test_package/test_core.cpp",
"conan/test_package/test_easy.cpp":"taxi/uservices/userver/conan/test_package/test_easy.cpp",
"conan/test_package/test_grpc.cpp":"taxi/uservices/userver/conan/test_package/test_grpc.cpp",
"conan/test_package/test_kafka.cpp":"taxi/uservices/userver/conan/test_package/test_kafka.cpp",
"conan/test_package/test_mongo.cpp":"taxi/uservices/userver/conan/test_package/test_mongo.cpp",
"conan/test_package/test_postgresql.cpp":"taxi/uservices/userver/conan/test_package/test_postgresql.cpp",
"conan/test_package/test_rabbitmq.cpp":"taxi/uservices/userver/conan/test_package/test_rabbitmq.cpp",
"conan/test_package/test_redis.cpp":"taxi/uservices/userver/conan/test_package/test_redis.cpp",
"conan/test_package/test_ubench.cpp":"taxi/uservices/userver/conan/test_package/test_ubench.cpp",
"conan/test_package/test_universal.cpp":"taxi/uservices/userver/conan/test_package/test_universal.cpp",
"conan/test_package/test_utest.cpp":"taxi/uservices/userver/conan/test_package/test_utest.cpp",
"conanfile.py":"taxi/uservices/userver/conanfile.py",
"core/CMakeLists.txt":"taxi/uservices/userver/core/CMakeLists.txt",
"core/README.md":"taxi/uservices/userver/core/README.md",
Expand Down
7 changes: 4 additions & 3 deletions cmake/UserverEmbedFile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,21 @@ function(userver_embed_file TARGET)
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/embedded &&
touch ${CMAKE_CURRENT_BINARY_DIR}/embedded/embedded.cpp
)

get_property(USERVER_CMAKE_DIR GLOBAL PROPERTY userver_cmake_dir)
add_custom_command(
OUTPUT
${CONFIG_HPP}
DEPENDS
${USERVER_ROOT_DIR}/cmake/embedded_config.cmake
${USERVER_CMAKE_DIR}/embedded_config.cmake
${ARG_FILEPATH}
COMMAND
${CMAKE_COMMAND}
-DUSERVER_ROOT_DIR=${USERVER_ROOT_DIR}
-DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR}
-DFILEPATH=${ARG_FILEPATH}
-DOUTPUT=${CONFIG_HPP}
-DNAME=${ARG_NAME}
-P ${USERVER_ROOT_DIR}/cmake/embedded_config.cmake
-P ${USERVER_CMAKE_DIR}/embedded_config.cmake
${CODEGEN}
)
add_library(${TARGET} STATIC ${CONFIG_HPP} ${CMAKE_CURRENT_BINARY_DIR}/embedded/embedded.cpp)
Expand Down
3 changes: 0 additions & 3 deletions conan/README.md

This file was deleted.

72 changes: 0 additions & 72 deletions conan/test_package/CMakeLists.txt

This file was deleted.

94 changes: 0 additions & 94 deletions conan/test_package/conanfile.py

This file was deleted.

36 changes: 0 additions & 36 deletions conan/test_package/hello.cpp

This file was deleted.

14 changes: 0 additions & 14 deletions conan/test_package/hello.hpp

This file was deleted.

20 changes: 0 additions & 20 deletions conan/test_package/hello_service.cpp

This file was deleted.

13 changes: 0 additions & 13 deletions conan/test_package/hello_service/CMakeLists.txt

This file was deleted.

3 changes: 0 additions & 3 deletions conan/test_package/hello_service/conftest.py

This file was deleted.

25 changes: 0 additions & 25 deletions conan/test_package/hello_service/hello_service.cpp

This file was deleted.

27 changes: 0 additions & 27 deletions conan/test_package/hello_service/static_config.yaml

This file was deleted.

Loading

0 comments on commit b5d3cb3

Please sign in to comment.