@@ -3,20 +3,16 @@ name: CMake
33on : [push, pull_request]
44
55env :
6- # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
7- BUILD_TYPE : RelWithDebInfo
8-
96 # Conan cache environment variables
107 CONAN_SYSREQUIRES_MODE : enabled
11- CONAN_USER_HOME : " ${{ github.workspace }}/conan-cache"
12- CONAN_USER_HOME_SHORT : " ${{ github.workspace }}/conan-cache/short"
8+ CONAN_USER_HOME : " ~/.conan2"
139
1410jobs :
1511 docker :
1612 name : Test docker images
1713 runs-on : ubuntu-22.04
1814 steps :
19- - uses : actions/checkout@v3
15+ - uses : actions/checkout@v4
2016
2117 - name : Build docker-ci image
2218 shell : bash
@@ -46,17 +42,18 @@ jobs:
4642 cxx : [17, 20]
4743
4844 steps :
49- - uses : actions/checkout@v3
45+ - uses : actions/checkout@v4
5046
5147 - name : Cache
52- uses : actions/cache@v3
48+ uses : actions/cache@v4
5349 env :
5450 cache-name : cache-conan-modules
5551 with :
5652 path : |
5753 ${{ env.CONAN_USER_HOME }}
5854 ~/.cache/pip
59- key : ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
55+ ~/.ccache
56+ key : ${{ runner.os }}-${{ matrix.cxx }}-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}-${{ hashFiles('conanfile.py') }}
6057
6158 - name : Install conan
6259 shell : bash
6865 run : |
6966 sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
7067 sudo apt update
71- sudo apt install ninja-build ${{ matrix.compiler.pkgs }}
68+ sudo apt install ninja-build ${{ matrix.compiler.pkgs }} ccache
7269 shell : bash
7370
7471 - name : Configure via CMake
@@ -100,17 +97,18 @@ jobs:
10097 cxx : [17]
10198
10299 steps :
103- - uses : actions/checkout@v3
100+ - uses : actions/checkout@v4
104101
105102 - name : Cache
106- uses : actions/cache@v3
103+ uses : actions/cache@v4
107104 env :
108105 cache-name : cache-conan-modules
109106 with :
110107 path : |
111108 ${{ env.CONAN_USER_HOME }}
112109 ~/.cache/pip
113- key : ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
110+ ~/.ccache
111+ key : ${{ runner.os }}-${{ matrix.cxx }}-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}-${{ hashFiles('conanfile.py') }}
114112
115113 - name : Install conan
116114 shell : bash
@@ -122,7 +120,7 @@ jobs:
122120 run : |
123121 sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
124122 sudo apt update
125- sudo apt install ninja-build ${{ matrix.compiler.pkgs }}
123+ sudo apt install ninja-build ${{ matrix.compiler.pkgs }} ccache
126124 shell : bash
127125
128126 - name : Configure via CMake
@@ -148,17 +146,18 @@ jobs:
148146 compiler : [{name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15 llvm-15-dev libclang-15-dev', iwyu_branch: 'clang_15', path_prefix: "/usr/lib/llvm-15"}]
149147
150148 steps :
151- - uses : actions/checkout@v3
149+ - uses : actions/checkout@v4
152150
153151 - name : Cache
154- uses : actions/cache@v3
152+ uses : actions/cache@v4
155153 env :
156154 cache-name : cache-conan-modules
157155 with :
158156 path : |
159157 ${{ env.CONAN_USER_HOME }}
160158 ~/.cache/pip
161- key : ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
159+ ~/.ccache
160+ key : ${{ runner.os }}-${{ matrix.cxx }}-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}-${{ hashFiles('conanfile.py') }}
162161
163162 - name : Install conan
164163 shell : bash
@@ -170,7 +169,7 @@ jobs:
170169 run : |
171170 sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
172171 sudo apt update
173- sudo apt install ninja-build ${{ matrix.compiler.pkgs }} cppcheck
172+ sudo apt install ninja-build ${{ matrix.compiler.pkgs }} cppcheck ccache
174173 shell : bash
175174
176175 - name : Compile and install IWYU
@@ -204,17 +203,18 @@ jobs:
204203 buildtype : [debug, release]
205204
206205 steps :
207- - uses : actions/checkout@v3
206+ - uses : actions/checkout@v4
208207
209208 - name : Cache
210- uses : actions/cache@v3
209+ uses : actions/cache@v4
211210 env :
212211 cache-name : cache-conan-modules
213212 with :
214213 path : |
215214 ${{ env.CONAN_USER_HOME }}
216215 ~/.cache/pip
217- key : ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
216+ ~/.ccache
217+ key : ${{ runner.os }}-${{ matrix.cxx }}-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}-${{ hashFiles('conanfile.py') }}
218218
219219 - name : Install conan
220220 shell : bash
@@ -225,7 +225,7 @@ jobs:
225225 - name : Install dependencies
226226 run : |
227227 sudo apt update
228- sudo apt install ninja-build wget
228+ sudo apt install ninja-build wget ccache
229229 shell : bash
230230
231231 - name : Install GCC ARM
@@ -254,17 +254,18 @@ jobs:
254254 compiler : [ {name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15'} ]
255255
256256 steps :
257- - uses : actions/checkout@v3
257+ - uses : actions/checkout@v4
258258
259259 - name : Cache
260- uses : actions/cache@v3
260+ uses : actions/cache@v4
261261 env :
262262 cache-name : cache-conan-modules
263263 with :
264264 path : |
265265 ${{ env.CONAN_USER_HOME }}
266266 ~/.cache/pip
267- key : ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
267+ ~/.ccache
268+ key : ${{ runner.os }}-${{ matrix.cxx }}-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}-${{ hashFiles('conanfile.py') }}
268269
269270 - name : Install conan
270271 shell : bash
@@ -276,7 +277,7 @@ jobs:
276277 run : |
277278 sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
278279 sudo apt update
279- sudo apt install ninja-build ${{ matrix.compiler.pkgs }}
280+ sudo apt install ninja-build ${{ matrix.compiler.pkgs }} ccache
280281 shell : bash
281282
282283 - name : Configure via CMake
@@ -294,21 +295,23 @@ jobs:
294295 fail-fast : false # 'false' means Don't stop matrix workflows even if some matrix entry fails.
295296 matrix :
296297 os : [ubuntu-22.04]
297- compiler : [ {name: 'Clang 15', preset: clang-15, pkgs: 'clang-15 llvm-15'} ]
298+ buildtype : [debug]
299+ compiler : [ {name: 'Clang 15', preset: clang-15-qt, pkgs: 'clang-15 llvm-15 llvm-15-dev llvm-15-linker-tools llvm-15-tools llvm-15-runtime'} ]
298300 cxx : [20]
299301
300302 steps :
301- - uses : actions/checkout@v3
303+ - uses : actions/checkout@v4
302304
303305 - name : Cache
304- uses : actions/cache@v3
306+ uses : actions/cache@v4
305307 env :
306308 cache-name : cache-conan-modules
307309 with :
308310 path : |
309311 ${{ env.CONAN_USER_HOME }}
310312 ~/.cache/pip
311- key : ${{ runner.os }}-${{ env.BUILD_TYPE }}-${{ hashFiles('CMakeLists.txt') }}-${{ hashFiles('cmake/Conan.cmake') }}
313+ ~/.ccache
314+ key : ${{ runner.os }}-${{ matrix.cxx }}-${{ matrix.compiler.preset }}-${{ matrix.buildtype }}-${{ hashFiles('conanfile.py') }}
312315
313316 - name : Install conan
314317 shell : bash
@@ -318,9 +321,10 @@ jobs:
318321
319322 - name : Install dependencies
320323 run : |
324+ sudo apt remove clang* llvm*
321325 sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
322326 sudo apt update
323- sudo apt install ninja-build ${{ matrix.compiler.pkgs }} libx11-xcb-dev libfontenc-dev libice-dev \
327+ sudo apt install clang ninja-build build-essential ccache ${{ matrix.compiler.pkgs }} libx11-xcb-dev libfontenc-dev libice-dev \
324328 libsm-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxi-dev \
325329 libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev \
326330 libxss-dev libxt-dev libxtst-dev libxv-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev \
@@ -332,12 +336,12 @@ jobs:
332336
333337 - name : Configure via CMake
334338 shell : bash
335- run : cmake --preset ${{ matrix.compiler.preset }}-qt -DCXX_STANDARD=${{ matrix.cxx }}
339+ run : cmake --preset ${{ matrix.compiler.preset }} -DCXX_STANDARD=${{ matrix.cxx }}
336340
337341 - name : Build
338342 shell : bash
339- run : cmake --build --preset build-${{ matrix.compiler.preset }}-qt
343+ run : cmake --build --preset build-${{ matrix.compiler.preset }}
340344
341345 - name : Test
342346 shell : bash
343- run : ctest --preset test-${{ matrix.compiler.preset }}-qt
347+ run : ctest --preset test-${{ matrix.compiler.preset }}
0 commit comments