14
14
CMAKE_GENERATOR : Ninja
15
15
DEFAULT_CXX_STANDARD : 20
16
16
DEFAULT_LLVM_VERSION : 18
17
- DEFAULT_GCC_VERSION : 12
17
+ DEFAULT_GCC_VERSION : 13
18
18
19
19
concurrency :
20
20
group : ${{ github.head_ref || github.run_id }}
@@ -125,13 +125,15 @@ jobs:
125
125
sudo apt install -y ninja-build
126
126
127
127
- name : Restore CPM cache
128
+ env :
129
+ cache-name : cpm-cache-0
128
130
id : cpm-cache-restore
129
131
uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
130
132
with :
131
133
path : ~/cpm-cache
132
- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
134
+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
133
135
restore-keys : |
134
- ${{ runner.os }}-cpm -
136
+ ${{runner.os}}-${{env.cache-name}} -
135
137
136
138
- name : Configure CMake
137
139
env :
@@ -140,11 +142,13 @@ jobs:
140
142
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
141
143
142
144
- name : Save CPM cache
145
+ env :
146
+ cache-name : cpm-cache-0
143
147
if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
144
148
uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
145
149
with :
146
150
path : ~/cpm-cache
147
- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
151
+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
148
152
149
153
- name : Build Unit Tests
150
154
run : cmake --build ${{github.workspace}}/build --config ${{matrix.build_type}} -v -t build_unit_tests
@@ -156,7 +160,17 @@ jobs:
156
160
quality_checks_pass :
157
161
runs-on : ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
158
162
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
160
174
161
175
- name : Install build tools
162
176
run : |
@@ -169,29 +183,34 @@ jobs:
169
183
sudo pip3 install pyyaml cmake-format
170
184
171
185
- name : Restore CPM cache
186
+ env :
187
+ cache-name : cpm-cache-0
172
188
id : cpm-cache-restore
173
189
uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
174
190
with :
175
191
path : ~/cpm-cache
176
- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
192
+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
177
193
restore-keys : |
178
- ${{ runner.os }}-cpm -
194
+ ${{runner.os}}-${{env.cache-name}} -
179
195
180
196
- name : Configure CMake
181
197
env :
182
198
CC : " /usr/lib/llvm-${{env.DEFAULT_LLVM_VERSION}}/bin/clang"
183
199
CXX : " /usr/lib/llvm-${{env.DEFAULT_LLVM_VERSION}}/bin/clang++"
200
+ PR_TARGET_BRANCH : ${{ steps.target_branch.outputs.branch }}
184
201
run : cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{env.DEFAULT_CXX_STANDARD}} -DCPM_SOURCE_CACHE=~/cpm-cache
185
202
186
203
- name : Save CPM cache
204
+ env :
205
+ cache-name : cpm-cache-0
187
206
if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
188
207
uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
189
208
with :
190
209
path : ~/cpm-cache
191
- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
210
+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
192
211
193
212
- name : Run quality checks
194
- run : cmake --build ${{github.workspace}}/build -t quality
213
+ run : cmake --build ${{github.workspace}}/build -t ci- quality
195
214
196
215
sanitize :
197
216
runs-on : ${{ github.repository_owner == 'intel' && 'intel-' || '' }}ubuntu-22.04
@@ -207,9 +226,9 @@ jobs:
207
226
install : wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18
208
227
toolchain_root : " /usr/lib/llvm-18"
209
228
- 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
213
232
toolchain_root : " /usr"
214
233
215
234
steps :
@@ -221,13 +240,15 @@ jobs:
221
240
sudo apt install -y ninja-build
222
241
223
242
- name : Restore CPM cache
243
+ env :
244
+ cache-name : cpm-cache-0
224
245
id : cpm-cache-restore
225
246
uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
226
247
with :
227
248
path : ~/cpm-cache
228
- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
249
+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
229
250
restore-keys : |
230
- ${{ runner.os }}-cpm -
251
+ ${{runner.os}}-${{env.cache-name}} -
231
252
232
253
- name : Configure CMake
233
254
env :
@@ -237,11 +258,20 @@ jobs:
237
258
run : cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{env.DEFAULT_CXX_STANDARD}} -DCPM_SOURCE_CACHE=~/cpm-cache
238
259
239
260
- name : Save CPM cache
261
+ env :
262
+ cache-name : cpm-cache-0
240
263
if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
241
264
uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
242
265
with :
243
266
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
245
275
246
276
- name : Build Unit Tests
247
277
run : cmake --build ${{github.workspace}}/build -t unit_tests
@@ -252,16 +282,20 @@ jobs:
252
282
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
253
283
254
284
- 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
256
288
257
289
- name : Restore CPM cache
290
+ env :
291
+ cache-name : cpm-cache-0
258
292
id : cpm-cache-restore
259
293
uses : actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
260
294
with :
261
295
path : ~/cpm-cache
262
- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
296
+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
263
297
restore-keys : |
264
- ${{ runner.os }}-cpm -
298
+ ${{runner.os}}-${{env.cache-name}} -
265
299
266
300
- name : Configure CMake
267
301
env :
@@ -270,11 +304,13 @@ jobs:
270
304
run : cmake -B ${{github.workspace}}/build -DCMAKE_CXX_STANDARD=${{env.DEFAULT_CXX_STANDARD}} -DCPM_SOURCE_CACHE=~/cpm-cache
271
305
272
306
- name : Save CPM cache
307
+ env :
308
+ cache-name : cpm-cache-0
273
309
if : steps.cpm-cache-restore.outputs.cache-hit != 'true'
274
310
uses : actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
275
311
with :
276
312
path : ~/cpm-cache
277
- key : ${{ runner.os }}-cpm- ${{ hashFiles('**/') }}
313
+ key : ${{runner.os}}-${{env.cache-name}}- ${{ hashFiles('**/CMakeLists.txt', 'cmake/** ') }}
278
314
279
315
- name : Build Unit Tests
280
316
run : cmake --build ${{github.workspace}}/build -t build_unit_tests
0 commit comments