Skip to content

Commit 8e79c97

Browse files
committed
Merge branch 'dev'
2 parents 12427fc + a9a165a commit 8e79c97

4 files changed

Lines changed: 36 additions & 8 deletions

File tree

.github/workflows/ci.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ jobs:
1010
build:
1111
runs-on: ${{ matrix.os }}
1212
strategy:
13+
fail-fast: false
1314
matrix:
1415
os: [ubuntu-latest, windows-latest, macos-latest]
16+
1517
steps:
1618
- uses: actions/checkout@v4
1719

@@ -22,12 +24,26 @@ jobs:
2224
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
2325
runVcpkgInstall: true
2426

25-
- name: Configure CMake
26-
run: cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
27+
- name: Configure CMake (Windows)
28+
if: runner.os == 'Windows'
29+
run: >
30+
cmake -B build -S .
31+
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
32+
-DBUILD_TESTS=ON
33+
-DBUILD_EXAMPLES=OFF
34+
35+
- name: Configure CMake (Linux/macOS)
36+
if: runner.os != 'Windows'
37+
run: >
38+
cmake -B build -S .
39+
-DCMAKE_BUILD_TYPE=Release
40+
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake
41+
-DBUILD_TESTS=ON
42+
-DBUILD_EXAMPLES=OFF
2743
2844
- name: Build (Windows)
2945
if: runner.os == 'Windows'
30-
run: cmake --build build
46+
run: cmake --build build --config Release
3147
shell: pwsh
3248

3349
- name: Build (Linux)
@@ -38,3 +54,15 @@ jobs:
3854
if: runner.os == 'macOS'
3955
run: cmake --build build -- -j$(sysctl -n hw.logicalcpu)
4056

57+
- name: Test (Windows)
58+
if: runner.os == 'Windows'
59+
run: ctest --test-dir build -C Release --output-on-failure
60+
shell: pwsh
61+
62+
- name: Test (Linux)
63+
if: runner.os == 'Linux'
64+
run: ctest --test-dir build --output-on-failure
65+
66+
- name: Test (macOS)
67+
if: runner.os == 'macOS'
68+
run: ctest --test-dir build --output-on-failure

CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ option(BUILD_TESTS "Build tests" OFF)
99

1010
find_package(nlohmann_json CONFIG REQUIRED)
1111
find_package(CURL CONFIG REQUIRED)
12-
find_package(GTest CONFIG REQUIRED)
1312

1413
file(GLOB SOURCES "src/*.cpp")
1514

@@ -24,8 +23,6 @@ target_include_directories(yandex-disk-cpp-client
2423
target_link_libraries(yandex-disk-cpp-client
2524
PUBLIC nlohmann_json::nlohmann_json
2625
CURL::libcurl
27-
GTest::gtest
28-
GTest::gtest_main
2926
)
3027

3128
# === Build each example as a separate executable ===

tests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
cmake_minimum_required(VERSION 3.28)
2+
23
find_package(GTest CONFIG REQUIRED)
34
include(GoogleTest)
45

@@ -12,6 +13,7 @@ add_executable(yandex-disk-cpp-client-tests
1213
target_link_libraries(yandex-disk-cpp-client-tests
1314
PRIVATE
1415
yandex-disk-cpp-client
16+
GTest::gtest
1517
GTest::gtest_main
1618
)
1719

vcpkg.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "yandex-disk-cpp-client",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"builtin-baseline": "a345bbdc68cdfda65603e24413b21afb28f110fb",
55
"dependencies": [
66
"curl",
7-
"nlohmann-json"
7+
"nlohmann-json",
8+
"gtest"
89
]
910
}

0 commit comments

Comments
 (0)