1414 CMAKE_GENERATOR : Ninja
1515 DEFAULT_CXX_STANDARD : 20
1616 DEFAULT_LLVM_VERSION : 18
17- DEFAULT_GCC_VERSION : 12
17+ DEFAULT_GCC_VERSION : 13
1818
1919concurrency :
2020 group : ${{ github.head_ref || github.run_id }}
@@ -125,13 +125,15 @@ jobs:
125125 sudo apt install -y ninja-build
126126
127127 - name : Restore CPM cache
128+ env :
129+ cache-name : cpm-cache-0
128130 id : cpm-cache-restore
129131 uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
130132 with :
131133 path : ~/cpm-cache
132- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
134+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
133135 restore-keys : |
134- ${{ runner.os }}-cpm -
136+ ${{runner.os}}-${{env.cache-name}} -
135137
136138 - name : Configure CMake
137139 env :
@@ -140,11 +142,13 @@ jobs:
140142 run : cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{matrix.cxx_standard}} -DCMAKE_CXX_FLAGS_INIT=${{matrix.cxx_flags}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DCPM_SOURCE_CACHE=~/cpm-cache
141143
142144 - name : Save CPM cache
145+ env :
146+ cache-name : cpm-cache-0
143147 if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
144148 uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
145149 with :
146150 path : ~/cpm-cache
147- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
151+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
148152
149153 - name : Build Unit Tests
150154 run : cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -v -t build_unit_tests
@@ -156,7 +160,17 @@ jobs:
156160 quality_checks_pass :
157161 runs-on : ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
158162 steps :
159- - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
163+ - name : Checkout target branch
164+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
165+ with :
166+ ref : ${{github.base_ref}}
167+
168+ - name : Extract target branch SHA
169+ run : echo "branch=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
170+ id : target_branch
171+
172+ - name : Checkout PR branch
173+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
160174
161175 - name : Install build tools
162176 run : |
@@ -169,29 +183,34 @@ jobs:
169183 sudo pip3 install pyyaml cmake-format
170184
171185 - name : Restore CPM cache
186+ env :
187+ cache-name : cpm-cache-0
172188 id : cpm-cache-restore
173189 uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
174190 with :
175191 path : ~/cpm-cache
176- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
192+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
177193 restore-keys : |
178- ${{ runner.os }}-cpm -
194+ ${{runner.os}}-${{env.cache-name}} -
179195
180196 - name : Configure CMake
181197 env :
182198 CC : " /usr/lib/llvm-${{env.DEFAULT_LLVM_VERSION}}/bin/clang"
183199 CXX : " /usr/lib/llvm-${{env.DEFAULT_LLVM_VERSION}}/bin/clang++"
200+ PR_TARGET_BRANCH : ${{ steps.target_branch.outputs.branch }}
184201 run : cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{env.DEFAULT_CXX_STANDARD}} -DCPM_SOURCE_CACHE=~/cpm-cache
185202
186203 - name : Save CPM cache
204+ env :
205+ cache-name : cpm-cache-0
187206 if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
188207 uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
189208 with :
190209 path : ~/cpm-cache
191- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
210+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
192211
193212 - name : Run quality checks
194- run : cmake --build ${{github.workspace}}/build -t quality
213+ run : cmake --build ${{github.workspace}}/build -t ci- quality
195214
196215 sanitize :
197216 runs-on : ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
@@ -207,9 +226,9 @@ jobs:
207226 install : wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18
208227 toolchain_root : " /usr/lib/llvm-18"
209228 - compiler : gcc
210- cc : " gcc-12 "
211- cxx : " g++-12 "
212- install : sudo apt update && sudo apt install -y gcc-12
229+ cc : " gcc-13 "
230+ cxx : " g++-13 "
231+ install : sudo add- apt-repository -y ppa:ubuntu-toolchain-r/test && sudo apt update && sudo apt install -y gcc-13 g++-13
213232 toolchain_root : " /usr"
214233
215234 steps :
@@ -221,13 +240,15 @@ jobs:
221240 sudo apt install -y ninja-build
222241
223242 - name : Restore CPM cache
243+ env :
244+ cache-name : cpm-cache-0
224245 id : cpm-cache-restore
225246 uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
226247 with :
227248 path : ~/cpm-cache
228- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
249+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
229250 restore-keys : |
230- ${{ runner.os }}-cpm -
251+ ${{runner.os}}-${{env.cache-name}} -
231252
232253 - name : Configure CMake
233254 env :
@@ -237,11 +258,20 @@ jobs:
237258 run : cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{env.DEFAULT_CXX_STANDARD}} -DCPM_SOURCE_CACHE=~/cpm-cache
238259
239260 - name : Save CPM cache
261+ env :
262+ cache-name : cpm-cache-0
240263 if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
241264 uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
242265 with :
243266 path : ~/cpm-cache
244- key : ${{ runner.os }}-cpm-${{ hashFiles('**/') }}
267+ key : ${{runner.os}}-${{env.cache-name}}-${{ hashFiles('**/CMakeLists.txt', 'cmake/**') }}
268+
269+ # https://github.com/actions/runner-images/issues/9524
270+ - name : Fix kernel mmap rnd bits
271+ # Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
272+ # high-entropy ASLR in much newer kernels that GitHub runners are
273+ # using leading to random crashes: https://reviews.llvm.org/D148280
274+ run : sudo sysctl vm.mmap_rnd_bits=28
245275
246276 - name : Build Unit Tests
247277 run : cmake --build ${{github.workspace}}/build -t unit_tests
@@ -252,16 +282,20 @@ jobs:
252282 - uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
253283
254284 - name : Install build tools
255- run : sudo apt update && sudo apt install -y gcc-${{env.DEFAULT_GCC_VERSION}} ninja-build valgrind
285+ run : |
286+ sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
287+ sudo apt update && sudo apt install -y gcc-${{env.DEFAULT_GCC_VERSION}} g++-${{env.DEFAULT_GCC_VERSION}} ninja-build valgrind
256288
257289 - name : Restore CPM cache
290+ env :
291+ cache-name : cpm-cache-0
258292 id : cpm-cache-restore
259293 uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
260294 with :
261295 path : ~/cpm-cache
262- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
296+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
263297 restore-keys : |
264- ${{ runner.os }}-cpm -
298+ ${{runner.os}}-${{env.cache-name}} -
265299
266300 - name : Configure CMake
267301 env :
@@ -270,11 +304,13 @@ jobs:
270304 run : cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{env.DEFAULT_CXX_STANDARD}} -DCPM_SOURCE_CACHE=~/cpm-cache
271305
272306 - name : Save CPM cache
307+ env :
308+ cache-name : cpm-cache-0
273309 if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
274310 uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
275311 with :
276312 path : ~/cpm-cache
277- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
313+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
278314
279315 - name : Build Unit Tests
280316 run : cmake --build ${{github.workspace}}/build -t build_unit_tests
0 commit comments