-
Notifications
You must be signed in to change notification settings - Fork 42
557 lines (554 loc) · 21.8 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
name: PeleLMeX-CI
on:
workflow_dispatch:
push:
branches: [development]
pull_request:
branches: [development]
concurrency:
group: ${{github.ref}}-${{github.head_ref}}-ci
cancel-in-progress: true
jobs:
Formatting:
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
- name: Check formatting
uses: DoozyX/[email protected]
with:
source: './Source ./Exec'
exclude: '.'
extensions: 'H,h,cpp'
clangFormatVersion: 18
CPU-GNUmake:
needs: Formatting
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup
working-directory: ./Exec/RegTests/FlameSheet
run: |
echo "NPROCS=$(nproc)" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=200M" >> $GITHUB_ENV
make COMP=gnu USE_MPI=FALSE DEBUG=TRUE TPL
make COMP=llvm USE_MPI=FALSE DEBUG=TRUE PRECISION=FLOAT TPL
- name: Install Ccache
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz
tar xvf ccache-4.8-linux-x86_64.tar.xz
sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/
- name: Set Up Ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{github.workflow}}-${{github.job}}-git-${{github.sha}}
restore-keys: |
ccache-${{github.workflow}}-${{github.job}}-git-
- name: FlameSheet debug make
working-directory: ./Exec/RegTests/FlameSheet
run: |
echo "::add-matcher::.github/problem-matchers/gcc.json"
set -eu -o pipefail
ccache -z
make -j ${{env.NPROCS}} DIM=2 KEEP_BUILDINFO_CPP=TRUE USE_CCACHE=TRUE COMP=gnu USE_MPI=FALSE DEBUG=TRUE 2>&1 | tee -a build-output.txt
- name: FlameSheet ccache report
working-directory: ./Exec/RegTests/FlameSheet
run: |
ccache -s
du -hs ~/.cache/ccache
- name: FlameSheet debug test
working-directory: ./Exec/RegTests/FlameSheet
run: ./PeleLMeX2d.gnu.DEBUG.ex flamesheet-drm19-2d.inp amr.max_step=1 amr.plot_int=-1 amr.check_int=-1
- name: FlameSheet debug report
working-directory: ./Exec/RegTests/FlameSheet
run: |
egrep "warning:|error:" build-output.txt \
| egrep -v "Submodules/amrex|Submodules/sundials|Submodules/AMReX-Hydro|GNUmakefile|ThirdParty" \
| egrep -v "ld: warning:" | sort | uniq \
| awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > warnings.txt
cat warnings.txt
export return=$(tail -n 1 warnings.txt | awk '{print $2}')
exit ${return}
CPU-CMake:
needs: Formatting
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
build_type: [Release, Debug]
enable_eb: [EB-OFF, EB-ON]
include:
- os: macos-latest
install_deps: brew install mpich automake ccache
comp: llvm
procs: $(sysctl -n hw.ncpu)
ccache_cache: /Users/runner/Library/Caches/ccache
- os: ubuntu-latest
install_deps: sudo apt-get update && sudo apt-get install mpich libmpich-dev
comp: gnu
procs: $(nproc)
ccache_cache: ~/.cache/ccache
- build_type: Release
ctest_args: -LE no-ci
ccache_size: 100M
- build_type: Debug
ctest_args: -LE no-ci
ccache_size: 500M
- enable_eb: EB-OFF
use_eb: "OFF"
- enable_eb: EB-ON
use_eb: "ON"
exclude:
- os: macos-latest
build_type: Debug
steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: recursive
- name: Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Setup
run: |
echo "NPROCS=${{matrix.procs}}" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=${{matrix.ccache_size}}" >> $GITHUB_ENV
cmake -E make_directory ${{runner.workspace}}/deps
if [ "${RUNNER_OS}" != "macOS" ]; then
${{github.workspace}}/Submodules/PelePhysics/Submodules/amrex/.github/workflows/dependencies/ubuntu_free_disk_space.sh
fi
- name: Dependencies
run: |
# Install MPI
${{matrix.install_deps}}
# Install Python packages
python -m pip install --upgrade pip
pip install pynose numpy pandas
- name: Install Ccache
run: |
if [ "${RUNNER_OS}" != "macOS" ]; then
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz
tar xvf ccache-4.8-linux-x86_64.tar.xz
sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/
fi
- name: Set Up Ccache
uses: actions/cache@v4
with:
path: ${{matrix.ccache_cache}}
key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.os}}-${{matrix.build_type}}-${{matrix.enable_eb}}-git-${{github.sha}}
restore-keys: |
ccache-${{github.workflow}}-${{github.job}}-${{matrix.os}}-${{matrix.build_type}}-${{matrix.enable_eb}}-git-
- name: Configure
run: |
(for DIM in 2 3; do \
printf "\n-------- Configuring ${DIM}D --------\n"; \
cmake -B${{runner.workspace}}/build-${DIM}d-${{matrix.os}}-${{matrix.build_type}}-${{matrix.enable_eb}} \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install-${DIM}d-${{matrix.os}}-${{matrix.build_type}}-${{matrix.enable_eb}} \
-DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DPELE_DIM:STRING=${DIM} \
-DPELE_ENABLE_MPI:BOOL=ON \
-DPELE_ENABLE_EB:BOOL=${{matrix.use_eb}} \
-DPELE_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \
${{github.workspace}}; \
if [ $? -ne 0 ]; then exit 1; fi \
done)
- name: Build
run: |
ccache -z
(for DIM in 2 3; do \
printf "\n-------- Building ${DIM}D --------\n"; \
cmake --build ${{runner.workspace}}/build-${DIM}d-${{matrix.os}}-${{matrix.build_type}}-${{matrix.enable_eb}} \
--parallel ${{env.NPROCS}} 2>&1 | tee -a ${{runner.workspace}}/build-output.txt; \
if [ ${PIPESTATUS[0]} -ne 0 ]; then exit 1; fi \
done)
- name: Ccache Report
run: |
ccache -s
du -hs ${{matrix.ccache_cache}}
- name: Report
run: |
echo "::add-matcher::.github/problem-matchers/gcc.json"
egrep "warning:|error:" ${{runner.workspace}}/build-output.txt \
| egrep -v "Submodules/amrex|Submodules/sundials|Submodules/AMReX-Hydro" \
| egrep -v "ld: warning:" | egrep -v "lto-wrapper: warning:" | sort | uniq \
| awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > ${{runner.workspace}}/build-output-warnings.txt
cat ${{runner.workspace}}/build-output-warnings.txt
export return=$(tail -n 1 ${{runner.workspace}}/build-output-warnings.txt | awk '{print $2}')
exit ${return}
- name: Test
run: |
(for DIM in 2 3; do \
printf "\n-------- Testing ${DIM}D --------\n"; \
cd ${{runner.workspace}}/build-${DIM}d-${{matrix.os}}-${{matrix.build_type}}-${{matrix.enable_eb}}; \
ctest -j ${{env.NPROCS}} ${{matrix.ctest_args}} --output-on-failure; \
if [ $? -ne 0 ]; then exit 1; fi \
done)
GPU-Nvidia:
name: GPU-CUDA
needs: [Formatting, CPU-GNUmake]
runs-on: ubuntu-20.04
strategy:
matrix:
cuda_ver: [11.4]
include:
- cuda_ver: "11.4"
cuda_pkg: 11-4
steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup
run: |
echo "NPROCS=$(nproc)" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=300M" >> $GITHUB_ENV
- name: Dependencies
run: |
${{github.workspace}}/Submodules/PelePhysics/Submodules/amrex/.github/workflows/dependencies/ubuntu_free_disk_space.sh
curl -O https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb
sudo apt-get update
sudo apt-get install -y \
cuda-command-line-tools-${{matrix.cuda_pkg}} \
cuda-compiler-${{matrix.cuda_pkg}} cuda-minimal-build-${{matrix.cuda_pkg}} \
cuda-nvml-dev-${{matrix.cuda_pkg}} cuda-nvtx-${{matrix.cuda_pkg}} \
libcurand-dev-${{matrix.cuda_pkg}} cuda-cupti-dev-${{matrix.cuda_pkg}} \
libcusolver-dev-${{matrix.cuda_pkg}} libcusparse-dev-${{matrix.cuda_pkg}} \
libcublas-dev-${{matrix.cuda_pkg}}
- name: Install Ccache
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz
tar xvf ccache-4.8-linux-x86_64.tar.xz
sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/
- name: Set Up Ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{github.workflow}}-${{github.job}}-git-${{github.sha}}
restore-keys: |
ccache-${{github.workflow}}-${{github.job}}-git-
- name: Configure
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda-${{matrix.cuda_ver}}/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH}
cmake -Bbuild-${{matrix.cuda_pkg}} \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DPELE_ENABLE_MPI:BOOL=OFF \
-DPELE_ENABLE_CUDA:BOOL=ON \
-DAMReX_CUDA_ERROR_CAPTURE_THIS:BOOL=ON \
-DCMAKE_CUDA_ARCHITECTURES:STRING=70 \
-DCMAKE_CUDA_COMPILER_LAUNCHER:STRING=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \
${{github.workspace}}
- name: Build
run: |
ccache -z
cmake --build build-${{matrix.cuda_pkg}} --parallel ${{env.NPROCS}}
- name: Ccache Report
run: |
ccache -s
du -hs ~/.cache/ccache
GPU-AMD:
name: GPU-HIP
needs: [Formatting, CPU-GNUmake]
runs-on: ubuntu-20.04
steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup
run: |
echo "NPROCS=$(nproc)" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=80M" >> $GITHUB_ENV
- name: Dependencies
run: |
${{github.workspace}}/Submodules/PelePhysics/Submodules/amrex/.github/workflows/dependencies/ubuntu_free_disk_space.sh
curl -O https://repo.radeon.com/rocm/rocm.gpg.key
sudo apt-key add rocm.gpg.key
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.6.1 ubuntu main' \
| sudo tee /etc/apt/sources.list.d/rocm.list
echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \
| sudo tee -a /etc/profile.d/rocm.sh
sudo apt-get update
sudo apt-get install -y rocm-dev rocrand-dev rocprim-dev
- name: Install Ccache
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz
tar xvf ccache-4.8-linux-x86_64.tar.xz
sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/
- name: Set Up Ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{github.workflow}}-${{github.job}}-git-${{github.sha}}
restore-keys: |
ccache-${{github.workflow}}-${{github.job}}-git-
- name: Configure
run: |
source /etc/profile.d/rocm.sh
which clang
which clang++
which hipcc
cmake -B${{runner.workspace}}/build-hip \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_CXX_COMPILER:STRING=$(which clang++) \
-DCMAKE_C_COMPILER:STRING=$(which clang) \
-DPELE_ENABLE_MPI:BOOL=OFF \
-DPELE_ENABLE_HIP:BOOL=ON \
-DAMReX_AMD_ARCH:STRING=gfx90a \
-DCMAKE_HIP_ARCHITECTURES:STRING=gfx90a \
-DAMDGPU_TARGETS:STRING=gfx90a \
-DGPU_TARGETS:STRING=gfx90a \
-DAMReX_GPU_RDC:BOOL=OFF \
-DPELE_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \
${{github.workspace}}
- name: Build
run: |
echo "::add-matcher::.github/problem-matchers/gcc.json"
source /etc/profile.d/rocm.sh
ccache -z
cmake --build ${{runner.workspace}}/build-hip --parallel ${{env.NPROCS}}
- name: Ccache Report
run: |
ccache -s
du -hs ~/.cache/ccache
GPU-Intel:
name: GPU-SYCL
needs: [Formatting, CPU-GNUmake]
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup
run: |
echo "NPROCS=$(nproc)" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=80M" >> $GITHUB_ENV
echo "CCACHE_DEPEND=1" >> $GITHUB_ENV
- name: Dependencies
run: |
${{github.workspace}}/Submodules/PelePhysics/Submodules/amrex/.github/workflows/dependencies/ubuntu_free_disk_space.sh
sudo wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" \
| sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel
- name: Install Ccache
run: |
wget https://github.com/ccache/ccache/releases/download/v4.8/ccache-4.8-linux-x86_64.tar.xz
tar xvf ccache-4.8-linux-x86_64.tar.xz
sudo cp -f ccache-4.8-linux-x86_64/ccache /usr/local/bin/
- name: Set Up Ccache
uses: actions/cache@v4
with:
path: ~/.cache/ccache
key: ccache-${{github.workflow}}-${{github.job}}-git-${{github.sha}}
restore-keys: |
ccache-${{github.workflow}}-${{github.job}}-git-
- name: Configure
run: |
set +e
source /opt/intel/oneapi/setvars.sh
set -e
cmake -B${{runner.workspace}}/build-sycl \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_CXX_COMPILER:STRING=$(which icpx) \
-DCMAKE_C_COMPILER:STRING=$(which icx) \
-DCMAKE_CXX_FLAGS:STRING=-fsycl \
-DPELE_ENABLE_MPI:BOOL=OFF \
-DPELE_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
-DPELE_ENABLE_SYCL:BOOL=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \
${{github.workspace}}
- name: Build
run: |
set +e
source /opt/intel/oneapi/setvars.sh
set -e
ccache -z
cmake --build ${{runner.workspace}}/build-sycl --parallel ${{env.NPROCS}}
- name: Ccache Report
run: |
ccache -s
du -hs ~/.cache/ccache
Lint-clang-tidy:
needs: Formatting
runs-on: macos-13
strategy:
matrix:
enable_eb: [EB-OFF, EB-ON]
include:
- enable_eb: EB-OFF
use_eb: "OFF"
- enable_eb: EB-ON
use_eb: "ON"
fail-fast: false
steps:
- name: Setup
run: |
echo "NPROCS=$(sysctl -n hw.ncpu)" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=1" >> $GITHUB_ENV
echo "CCACHE_LOGFILE=${{github.workspace}}/ccache.log.txt" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=80M" >> $GITHUB_ENV
- name: Clone
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Ccache
run: |
brew install ccache
- name: Set Up Ccache
uses: actions/cache@v4
with:
path: /Users/runner/Library/Caches/ccache
key: ccache-${{github.workflow}}-${{github.job}}-${{matrix.enable_eb}}-git-${{github.sha}}
restore-keys: |
ccache-${{github.workflow}}-${{github.job}}-${{matrix.enable_eb}}-git-
- name: Configure
run: |
export PATH=$(brew --prefix llvm@15)/bin:${PATH}
cmake -B${{runner.workspace}}/build-clang-tidy \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_CXX_COMPILER:STRING=clang++ \
-DCMAKE_C_COMPILER:STRING=clang \
-DPELE_ENABLE_EB:BOOL=${{matrix.use_eb}} \
-DPELE_ENABLE_MPI:BOOL=OFF \
-DPELE_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
-DPELE_ENABLE_CLANG_TIDY:BOOL=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache \
${{github.workspace}}
- name: Check
working-directory: ${{runner.workspace}}/build-clang-tidy
run: |
#set -eu -o pipefail
export PATH=$(brew --prefix llvm@15)/bin:${PATH}
cmake --build . --parallel ${{env.NPROCS}} 2>&1 | tee -a clang-tidy-full-report.txt
egrep "warning:|error:" clang-tidy-full-report.txt \
| egrep -v "Submodules/amrex|Submodules/sundials|Submodules/AMReX-Hydro" \
| egrep -v "ld: warning:" | sort | uniq \
| awk 'BEGIN{i=0}{print $0}{i++}END{print "Warnings: "i}' > clang-tidy-warnings.txt
- name: Ccache Report
run: |
ccache -s
du -hs /Users/runner/Library/Caches/ccache
- name: Full report
working-directory: ${{runner.workspace}}/build-clang-tidy
run: cat clang-tidy-full-report.txt
- name: Short report
working-directory: ${{runner.workspace}}/build-clang-tidy
run: |
echo "::add-matcher::.github/problem-matchers/gcc.json"
cat clang-tidy-warnings.txt
export return=$(tail -n 1 clang-tidy-warnings.txt | awk '{print $2}')
exit ${return}
Lint-codeql:
needs: Formatting
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: recursive
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: cpp
queries: +security-and-quality
config-file: ./.github/codeql/codeql-config.yml
- name: Configure
run: |
echo "NPROCS=$(nproc)" >> $GITHUB_ENV
cmake -B${{runner.workspace}}/build-codeql \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DCMAKE_CXX_COMPILER:STRING=clang++ \
-DCMAKE_C_COMPILER:STRING=clang \
-DPELE_ENABLE_MPI:BOOL=OFF \
-DPELE_ENABLE_FCOMPARE_FOR_TESTS:BOOL=OFF \
-DPELE_ENABLE_CLANG_TIDY:BOOL=OFF \
${{github.workspace}}
- name: Build
run: |
cmake --build ${{runner.workspace}}/build-codeql --parallel ${{env.NPROCS}}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:cpp"
upload: False
output: sarif-results
- name: Filter CodeQL sarif
uses: advanced-security/filter-sarif@v1
with:
patterns: |
-**/Submodules/sundials/**
-**/Submodules/amrex/**
-**/Submodules/AMReX-Hydro/**
input: sarif-results/cpp.sarif
output: sarif-results/cpp.sarif
- name: Upload CodeQL sarif
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: sarif-results/cpp.sarif
Lint-codespell:
needs: Formatting
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v4
with:
submodules: false
- name: Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Dependencies
run: |
# Install Python packages
python -m pip install --upgrade pip
pip install codespell
- name: Run codespell
run: codespell
Save-PR-Number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v4
with:
name: pr_number
path: pr_number.txt
retention-days: 1