@@ -11,13 +11,24 @@ jobs:
11
11
build :
12
12
strategy :
13
13
matrix :
14
- os : [ubuntu-22.04, windows-2019 ]
14
+ os : [ubuntu-22.04, windows-2022 ]
15
15
BUILD_TYPE : [RelWithDebInfo, Debug]
16
16
include :
17
17
- CONAN_BUILD_TYPE : Debug
18
18
BUILD_TYPE : Debug
19
19
- CONAN_BUILD_TYPE : Release
20
20
BUILD_TYPE : RelWithDebInfo
21
+ # preset names are handled differently by conan as on windows it uses a multi-config generator, on linux a single config generator
22
+ # See https://docs.conan.io/2/examples/tools/cmake/cmake_toolchain/build_project_cmake_presets.html#building-the-project-using-cmakepresets
23
+ - BUILD_TYPE : RelWithDebInfo
24
+ os : ubuntu-22.04
25
+ presetName : conan-relwithdebinfo
26
+ - BUILD_TYPE : Debug
27
+ os : ubuntu-22.04
28
+ presetName : conan-debug
29
+ - os : windows-2022
30
+ presetName : conan-default
31
+
21
32
22
33
runs-on : ${{matrix.os}}
23
34
steps :
@@ -27,33 +38,37 @@ jobs:
27
38
id : conan
28
39
uses : turtlebrowser/get-conan@main
29
40
with :
30
- version : 1.66 .0
41
+ version : 2.12 .0
31
42
32
43
- name : Detect Conan Profile
33
- run : conan profile new default --detect
34
-
35
- - name : Fix libcxx setting
36
- run : conan profile update settings.compiler.libcxx=libstdc++11 default
37
- if : matrix.os == 'ubuntu-22.04'
38
-
44
+ run : conan profile detect
45
+
39
46
- name : Install Dependencies
40
- run : conan install --install-folder ${{github.workspace}}/ build -s build_type=${{matrix.CONAN_BUILD_TYPE}} -o sqlite3:shared=True .
41
- # run: conan install --install -folder ${{github.workspace}}/build -s build_type=${{matrix.CONAN_BUILD_TYPE}} .
47
+ # "&:build_type=..." specifies the consumer packages build type, see https://github.com/conan-io/conan/issues/16852
48
+ run : conan install . --output -folder ${{github.workspace}}/build -s build_type=${{matrix.CONAN_BUILD_TYPE}} -s "&:build_type=${{matrix.BUILD_TYPE}}" -o "sqlite3/*:shared=True" --build=missing
42
49
43
50
- name : Configure CMake
44
- # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
45
- # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
46
- run : cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} -DBUILD_SHARED_LIBS=True
51
+ # Configure CMake in a 'build' subdirectory.
52
+ run : cmake --preset ${{matrix.presetName}} . -DBUILD_SHARED_LIBS=ON
47
53
48
54
- name : Build
49
55
# Build your program with the given configuration
50
56
run : cmake --build ${{github.workspace}}/build --config ${{matrix.BUILD_TYPE}}
51
57
52
- - name : Test
58
+ - name : Test (Win)
59
+ working-directory : ${{github.workspace}}/build
60
+ # Execute tests defined by the CMake configuration.
61
+ # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
62
+ run : .\conanrun.bat && ctest -C ${{matrix.BUILD_TYPE}} --output-on-failure
63
+ shell : cmd
64
+ if : runner.os == 'Windows'
65
+
66
+ - name : Test (Linux)
53
67
working-directory : ${{github.workspace}}/build
54
68
# Execute tests defined by the CMake configuration.
55
69
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
56
- run : ctest -C ${{matrix.BUILD_TYPE}} --output-on-failure
70
+ run : source conanrun.sh && ctest -C ${{matrix.BUILD_TYPE}} --output-on-failure
71
+ if : runner.os == 'Linux'
57
72
58
73
- name : CPack
59
74
if : ${{ github.event_name == 'release' }}
77
92
if : ${{ github.event_name == 'release' }}
78
93
strategy :
79
94
matrix :
80
- artifact_os : [ubuntu-22.04, windows-2019 ]
95
+ artifact_os : [ubuntu-22.04, windows-2022 ]
81
96
artifact_build_type : [RelWithDebInfo, Debug]
82
97
runs-on : ubuntu-22.04
83
98
steps :
0 commit comments