@@ -11,23 +11,40 @@ jobs:
11
11
include :
12
12
- os : ubuntu-latest
13
13
cmake_preset_name : conan-release
14
+ conan_home : " /home/runner/.conan2"
14
15
- os : macos-latest
15
16
cmake_preset_name : conan-release
17
+ conan_home : " /Users/runner/.conan2"
16
18
- os : windows-latest
17
19
cmake_preset_name : conan-default
20
+ conan_home : " C:/Users/runneradmin/.conan2"
18
21
fail-fast : false
19
22
runs-on : ${{ matrix.os }}
23
+ env :
24
+ CONAN_HOME : ${{ matrix.conan_home }}
20
25
steps :
21
26
- name : Checkout
22
27
uses : actions/checkout@v4
23
28
- uses : actions/setup-python@v4
24
29
with :
25
30
cache : ' pip' # caching pip dependencies
31
+ - name : " Cache Conan dependencies"
32
+ uses : actions/cache@v4
33
+ with :
34
+ path : " ${{matrix.conan_home}}"
35
+ key : ${{ runner.os }}-conan-${{ hashFiles('.github/workflows/conanfile.txt') }}
36
+ restore-keys : |
37
+ ${{ runner.os }}-conan-
26
38
- name : " install dependencies" # use conan package manager to install c and c++ dependencies
39
+ # conanfile.txt is copied to the root because for some reason, conan doesn't seem to create the top
40
+ # CMakeUserPresets.json if you have the conanfile.txt in another directory than the path you call conan from.
41
+ #
42
+ # "cmake -E copy" is used to copy the file is because it has the same interface across all operating systems.
27
43
run : |
28
44
pip install --disable-pip-version-check uv
29
- uvx conan profile detect
30
- uvx conan install -of build --requires="zlib/1.3.1" --requires="libxslt/1.1.43" --requires="libxml2/2.13.8" --requires="libzen/0.4.38" --requires="libmediainfo/22.03" --build=missing -g CMakeDeps -g CMakeToolchain
45
+ uvx conan profile detect --exist-ok
46
+ cmake -E copy .github/workflows/conanfile.txt conanfile.txt
47
+ uvx conan install -of build --build=missing -g CMakeDeps -g CMakeToolchain conanfile.txt
31
48
- name : Configure cmake
32
49
run : |
33
50
cmake --preset ${{ matrix.cmake_preset_name }} -D BUILD_SHARED_LIBS=${{ matrix.library_type == 'static' && 'NO' || 'YES'}}
0 commit comments