66 - devel
77 - master
88 pull_request :
9- branches :
10- - devel
11- - master
129
1310jobs :
1411 build-with-conda :
1512 name : ' [conda:${{ matrix.os }}:${{ matrix.build_type }}]'
1613 runs-on : ${{ matrix.os }}
14+ env :
15+ CCACHE_BASEDIR : ${GITHUB_WORKSPACE}
16+ CCACHE_DIR : ${GITHUB_WORKSPACE}/.ccache
17+ CCACHE_COMPRESS : true
18+ CCACHE_COMPRESSLEVEL : 5
19+ # Since conda will install a compiler, the compiler mtime will be changed.
20+ # This can invalidate the cache (https://ccache.dev/manual/latest.html#config_compiler_check)
21+ CCACHE_COMPILERCHECK : content
22+ # Help ccache manage generated files and PCH (https://ccache.dev/manual/latest.html#_precompiled_headers)
23+ CCACHE_SLOPPINESS : include_file_ctime,include_file_mtime,pch_defines,time_macros
1724
1825 strategy :
1926 fail-fast : false
@@ -23,28 +30,30 @@ jobs:
2330
2431 steps :
2532 - uses : actions/checkout@v5
33+ with :
34+ submodules : recursive
2635
27- - uses : conda-incubator/setup-miniconda@v3
36+ - uses : actions/cache@v4
2837 with :
29- channels : conda-forge
30- activate-environment : tsid
38+ path : .ccache
39+ key : ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}_${{ github.sha }}
40+ restore-keys : ccache-macos-linux-conda-${{ matrix.os }}-${{ matrix.build_type }}_
3141
32- - name : Install dependencies [Conda]
33- shell : bash -l {0}
42+ # Conda compiler is named x86_64-conda-linux-gnu-c++, ccache can't resolve it
43+ # (https://ccache.dev/manual/latest.html#config_compiler_type)
44+ - name : Configure ccache with conda GCC [Conda]
45+ if : contains(matrix.os, 'ubuntu')
3446 run : |
35- # Workaround for https://github.com/conda-incubator/setup-miniconda/issues/186
36- conda config --remove channels defaults
37- # Compilation related dependencies
38- conda install cmake compilers make pkg-config doxygen ninja graphviz
39- # Main dependencies
40- conda install tsid --only-deps
41- conda install proxsuite osqp-eigen
42-
43- - name : Activate ccache [Conda]
44- uses :
hendrikmuhs/[email protected] 47+ echo "CCACHE_COMPILERTYPE=gcc" >> "$GITHUB_ENV"
48+
49+ - uses : conda-incubator/setup-miniconda@v3
4550 with :
46- key : ${{ matrix.os }}-${{ matrix.type }}
47- max-size : 1G
51+ miniforge-version : latest
52+ activate-environment : tsid
53+ environment-file : .github/workflows/conda/environment.yml
54+ auto-activate-base : false
55+ auto-update-conda : true
56+ conda-remove-defaults : true
4857
4958 - name : Print environment [Conda]
5059 shell : bash -l {0}
@@ -53,49 +62,60 @@ jobs:
5362 conda list
5463 env
5564
65+ - name : Clear ccache statistics [Conda]
66+ shell : bash -l {0}
67+ run : |
68+ ccache -z
69+
5670 - name : Configure [Conda]
5771 shell : bash -l {0}
5872 run : |
59- echo $(whereis ccache)
60- echo $(which ccache)
61- git submodule update --init
6273 mkdir build
6374 cd build
64- cmake .. -GNinja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DBUILD_PYTHON_INTERFACE:BOOL=ON -DPYTHON_EXECUTABLE=$(which python3) -DINSTALL_DOCUMENTATION:BOOL=ON -DBUILD_WITH_PROXQP:BOOL=ON -DBUILD_WITH_OSQP:BOOL=ON
75+ cmake .. -GNinja\
76+ -DCMAKE_C_COMPILER_LAUNCHER=ccache\
77+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache\
78+ -DCMAKE_INSTALL_PREFIX=${CONDA_PREFIX}\
79+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}\
80+ -DBUILD_PYTHON_INTERFACE:BOOL=ON\
81+ -DPYTHON_EXECUTABLE=$(which python3)\
82+ -DINSTALL_DOCUMENTATION:BOOL=ON\
83+ -DBUILD_WITH_PROXQP:BOOL=ON\
84+ -DBUILD_WITH_OSQP:BOOL=ON
6585
6686 - name : Build [Conda]
6787 shell : bash -l {0}
6888 run : |
6989 cd build
70- cmake --build . --config ${{ matrix.build_type }} -v
90+ ninja
7191
7292 - name : Build documentation [Conda]
7393 shell : bash -l {0}
7494 run : |
7595 cd build
76- cmake --build . --config ${{ matrix.build_type }} --target doc
96+ ninja doc
7797
7898 - name : Install [Conda]
7999 shell : bash -l {0}
80100 run : |
81101 cd build
82- cmake -- install . --config ${{ matrix.build_type }}
102+ ninja install
83103
84104 - name : Test [Conda]
85105 shell : bash -l {0}
86106 run : |
87107 find $CONDA_PREFIX -name tsid*
88108 python -c "import tsid"
89109 cd build
90- ctest --output-on-failure -C ${{ matrix.build_type }}
110+ ctest --output-on-failure
91111
92112 - name : Uninstall [Conda]
93113 shell : bash -l {0}
94114 run : |
95115 cd build
96- cmake --build . --config ${{ matrix.build_type }} --target uninstall
116+ ninja uninstall
97117
98- - name : Display ccache statistics [Conda]
118+ - name : Print ccache statistics [Conda]
99119 shell : bash -l {0}
100120 run : |
101- echo $( ccache -s)
121+ ccache -sv
0 commit comments