Repository navigation
605 lines (526 loc) · 22 KB
/
Copy pathtest-cpp.yml
File metadata and controls
605 lines (526 loc) · 22 KB
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
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
name: C++ Code Checks
on:
push:
branches: [ "master" ]
pull_request:
workflow_dispatch:
jobs:
Codespell:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Lint With Codespell
run: |
python3 -m pip install --upgrade pip || true # Fails on macOS because of homebrew
python3 -m pip install codespell
codespell --ignore-words-list thirdparty,Ned $( git ls-tree -r --name-only HEAD | 'grep' -E '[.](py|md|txt|sh|yml|cpp|c|hpp|h)$' )
- name: Reject AI co-authorship
if: github.event_name == 'pull_request'
run: |
if git log \
"${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" \
--format='%B' |
grep -Eiq \
'^Co-Authored-By:.*<(.*@)?(anthropic\.com|openai\.com|google\.com|github\.com|amazon\.com|cursor\.com|cline\.bot|windsurf\.com|devin\.ai)>[[:space:]]*$'
then
echo "::error::AI co-authorship attribution is not permitted."
echo "::error::AI tools may be used, but the merge request creator must take full responsibility for the submitted work."
echo "::error::AI systems cannot assume responsibility for the changes and therefore must not be represented as co-authors."
echo "::error::Co-authorship attribution is considered promotional/advertising content and is prohibited by repository policy."
exit 1
fi
Code-Coverage:
name: Code Coverage
runs-on: ubuntu-26.04
# Suddenly, the upload to codecov does not work anymore and times out after 6 hours -.-.
# It's not like I used it much anyway, except to have a badge.
if: false
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Install Dependencies
run: |
sudo apt update
sudo apt-get -y install bzip2 cppcheck clang clang-tidy g++ lcov ninja-build wget gzip tabix pigz gztool libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip || true # Fails on macOS because of homebrew
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Code Coverage
run: |
mkdir -p build-codeov && cd -- "$_"
# It should be compiled with the same g++ version as anylzed with gcov!
# If g++ --version and gcov --version print different versions, there might be problems when creating
# the coverage report, e.g., I had: "version 'A85*', prefer 'B12*'".
# It is possible to specify a different gcov version to lcov using, e.g., lcov --gcov-tool gcov-8.
# For me it compiled with g++-8 but used gcov-11 by default!
CXX=g++ CC=gcc cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLIBRAPIDARCHIVE_CODE_COVERAGE=ON -DCMAKE_CXX_FLAGS="-DSHORT_TESTS" ..
cmake --build . -- check
lcov --capture --directory . --base-directory "$( cd .. && pwd )" --no-external --output-file coverage.info
lcov --list coverage.info
bash <( wget -O- -q https://codecov.io/bash ) -f coverage.info
- name: Run cppcheck
# Crashes on templated variable REVERSED_BITS_LUT<T>[value] (internalAstError)
if: false
run: |
set -o pipefail
cppcheck -j $( nproc ) --enable=all --std=c++17 --suppress=unusedFunction --suppress=useStlAlgorithm \
-I src/core \
-I src/indexed_bzip2 \
-I src/rapidgzip \
-I src/rapidgzip/huffman \
src/benchmarks \
src/core \
src/indexed_bzip2 \
src/rapidgzip \
src/tests \
src/tools 2>&1 | tee cppcheck.log
if grep -E -i 'error: .* \[[^]]*\]$' cppcheck.log; then
echo -e '\e[31mThere were errors while running cppcheck!\e[0m'
exit 1
fi
Clang-Tidy:
name: Clang-Tidy
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Install Dependencies
run: |
sudo apt update
sudo apt-get -y install clang clang-tidy ninja-build libarchive-dev zlib1g-dev nasm
- name: Run clang-tidy
run: |
CC=clang CXX=clang++ cmake -B build -G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLIBRAPIDARCHIVE_USE_SYSTEM_ZLIB=ON -DLIBRAPIDARCHIVE_RUN_CLANG_TIDY=ON .
cmake --build build
Check:
name: Check without Sanitizer and with ISA-L
# And especially without -DSHORT_TESTS, which makes it non redundant to the sanitizer checks!
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# ISA-L currently not supported on macOS. macos-xx would simply build without ISA-L and waste precious CI time.
os: [ubuntu-26.04, ubuntu-26.04-arm]
use_system_zlib: ['ON', 'OFF']
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Install System Dependencies
if: "startsWith(matrix.os , 'macos')"
run: |
brew install -q ninja pigz zlib isa-l wget nasm
wget 'https://github.com/samtools/htslib/releases/download/1.20/htslib-1.20.tar.bz2'
tar -xf htslib-1.20.tar.bz2
cd htslib* && ./configure --prefix="$PWD/installed" && make install
echo PATH="$PWD/installed/bin:$PATH" >> "${GITHUB_ENV}"
- name: Install System Dependencies
if: "startsWith(matrix.os , 'ubuntu')"
run: |
sudo apt update
sudo apt-get -y install clang g++ ninja-build gzip tabix pigz gztool libarchive-dev zlib1g-dev isal nasm
- name: Fix pip
if: "startsWith(matrix.os , 'macos')"
run: |
mkdir -p "$HOME/Library/Application Support/pip"
cat <<EOF >> "$HOME/Library/Application Support/pip/pip.conf"
[global]
break-system-packages = true
EOF
- name: Fix pip
run: |
echo "PIP_BREAK_SYSTEM_PACKAGES=1" >> "${GITHUB_ENV}"
- name: Install Python Dependencies
run: |
python3 -m pip install --upgrade pip || true # Fails on macOS because of homebrew
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: System Information
run: |
cmake --version
g++ --version
clang --version
- name: Run Tar Test (Clang)
env:
LIBRAPIDARCHIVE_USE_SYSTEM_ZLIB: ${{ matrix.use_system_zlib }}
run: |
CXX=clang++ CC=clang cmake -B build-rapidgzip -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLIBRAPIDARCHIVE_WITH_ISAL=ON -DLIBRAPIDARCHIVE_USE_SYSTEM_ZLIB=$LIBRAPIDARCHIVE_USE_SYSTEM_ZLIB .
cmake --build build-rapidgzip -v -- rapidgzip
echo foo > bar && tar -czf bar.tar.gz bar && rm bar
tar -x --use-compress-program=build-rapidgzip/src/tools/rapidgzip -f bar.tar.gz
test -f bar
- name: Run Tests With Sanitizers (GCC)
env:
LIBRAPIDARCHIVE_USE_SYSTEM_ZLIB: ${{ matrix.use_system_zlib }}
run: |
CXX=g++ CC=gcc cmake -B build-gcc -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLIBRAPIDARCHIVE_WITH_ISAL=ON -DLIBRAPIDARCHIVE_USE_SYSTEM_ZLIB=$LIBRAPIDARCHIVE_USE_SYSTEM_ZLIB .
cmake --build build-gcc -v -- check
- name: Run Tests With Sanitizers (Clang)
env:
LIBRAPIDARCHIVE_USE_SYSTEM_ZLIB: ${{ matrix.use_system_zlib }}
run: |
CXX=clang++ CC=clang cmake -B build-clang -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLIBRAPIDARCHIVE_WITH_ISAL=ON -DLIBRAPIDARCHIVE_USE_SYSTEM_ZLIB=$LIBRAPIDARCHIVE_USE_SYSTEM_ZLIB .
cmake --build build-clang -v -- check
Check-Without-Isal:
name: Check without Sanitizer and without ISA-L
# And especially without -DSHORT_TESTS, which makes it non redundant to the sanitizer checks!
runs-on: ${{ matrix.os }}
# A hung test must fail cleanly instead of occupying a runner for the default six hours.
timeout-minutes: 180
strategy:
fail-fast: false
matrix:
os:
- ubuntu-26.04
- ubuntu-26.04-arm
- macos-26
- macos-26-intel
- windows-latest
env:
MACOSX_DEPLOYMENT_TARGET: "13.0"
steps:
- name: System Information
if: "! startsWith(matrix.os, 'windows')"
run: |
uname -a
- name: Print Architecture
if: "startsWith(matrix.os, 'macos')"
run: |
sysctl -n machdep.cpu.brand_string
arch
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Install System Dependencies
if: "startsWith(matrix.os , 'macos')"
run: |
brew install -q ninja pigz zlib isa-l wget
wget 'https://github.com/samtools/htslib/releases/download/1.20/htslib-1.20.tar.bz2'
tar -xf htslib-1.20.tar.bz2
cd htslib* && ./configure --prefix="$PWD/installed" && make install
echo PATH="$PWD/installed/bin:$PATH" >> "${GITHUB_ENV}"
- name: Install System Dependencies
if: "startsWith(matrix.os , 'ubuntu')"
run: |
sudo apt update
sudo apt-get -y install g++ ninja-build gzip tabix pigz gztool libarchive-dev zlib1g-dev isal
- name: Fix pip
if: "startsWith(matrix.os , 'macos')"
run: |
mkdir -p "$HOME/Library/Application Support/pip"
cat <<EOF >> "$HOME/Library/Application Support/pip/pip.conf"
[global]
break-system-packages = true
EOF
- name: Fix pip
run: |
echo "PIP_BREAK_SYSTEM_PACKAGES=1" >> "${GITHUB_ENV}"
- name: Install Python Dependencies
run: |
python3 -m pip install --upgrade pip || true # Fails on macOS because of homebrew
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Build Examples
working-directory: src/examples/cmake-fetch-content
run: |
cmake -G Ninja -B build -DLIBRAPIDARCHIVE_WITH_ISAL=OFF .
cmake --build build
- name: Run Tests With Sanitizers
if: "startsWith(matrix.os , 'ubuntu')"
run: |
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Debug -DLIBRAPIDARCHIVE_WITH_ISAL=OFF .
cmake --build build -- check
- name: Run Tests
if: "startsWith(matrix.os , 'macos')"
run: |
# MacOS ARM is much slower and runs into a timeout without -DSHORT_TESTS. The Intel runners are
# slower still, so give each test a timeout and keep the runner from hanging indefinitely.
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Debug -DLIBRAPIDARCHIVE_WITH_ISAL=OFF -DCMAKE_CXX_FLAGS="-DSHORT_TESTS" .
cmake --build build -j 4
ctest --test-dir build -j 1 --output-on-failure --timeout 1800
- name: Enable Windows Crash Dumps
if: "startsWith(matrix.os , 'windows')"
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path "$env:RUNNER_TEMP\crashes" | Out-Null
New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Force | Out-Null
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name DumpFolder -Value "$env:RUNNER_TEMP\crashes"
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name DumpType -Value 2
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" -Name DumpCount -Value 20
- name: Run Tests
if: "startsWith(matrix.os , 'windows')"
run: |
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Debug -DLIBRAPIDARCHIVE_WITH_ISAL=OFF .
cmake --build build
# Run serially so the heavy tests do not compete for the Windows runner's memory.
ctest --test-dir build -j 1 --output-on-failure --extra-verbose
- name: Print Windows Crash Backtraces
if: always() && startsWith(matrix.os , 'windows')
shell: pwsh
run: |
Start-Sleep -Seconds 5
$dumps = Get-ChildItem "$env:RUNNER_TEMP\crashes" -Filter *.dmp -ErrorAction SilentlyContinue
if ( -not $dumps ) { Write-Host "No Windows crash dumps found."; exit 0 }
$candidates = @(
"${env:ProgramFiles(x86)}\Windows Kits\10\Debuggers\x64\cdb.exe",
"${env:ProgramFiles}\Windows Kits\10\Debuggers\x64\cdb.exe"
)
$cdb = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1
if ( -not $cdb ) { Write-Host "cdb.exe not found; dumps are in $env:RUNNER_TEMP\crashes"; exit 0 }
foreach ( $dump in $dumps ) {
Write-Host "=== $($dump.Name) ==="
& $cdb -z $dump.FullName -c "!analyze -v; kb; q"
}
- name: Upload Windows Crash Dumps
if: always() && startsWith(matrix.os , 'windows')
uses: actions/upload-artifact@v7
with:
name: windows-crash-dumps
path: ${{ runner.temp }}/crashes
if-no-files-found: ignore
Sanitize:
name: Sanitize
env:
ASAN_OPTIONS: abort_on_error=1:halt_on_error=1:detect_leaks=0
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-26.04
- ubuntu-26.04-arm
- macos-26
- macos-26-intel
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Install System Dependencies
if: "startsWith(matrix.os , 'macos')"
run: |
brew install -q ninja pigz zlib isa-l wget nasm
wget 'https://github.com/samtools/htslib/releases/download/1.20/htslib-1.20.tar.bz2'
tar -xf htslib-1.20.tar.bz2
cd htslib* && ./configure --prefix="$PWD/installed" && make install
echo PATH="$PWD/installed/bin:$PATH" >> "${GITHUB_ENV}"
- name: Install System Dependencies
if: "startsWith(matrix.os , 'ubuntu')"
run: |
sudo apt update
sudo apt-get -y install clang g++ ninja-build gzip tabix pigz gztool libarchive-dev zlib1g-dev isal nasm
- name: Fix pip
run: |
echo "PIP_BREAK_SYSTEM_PACKAGES=1" >> "${GITHUB_ENV}"
- name: Install Python Dependencies
run: |
python3 -m pip install --upgrade pip || true # Fails on macOS because of homebrew
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Sanitizers
if: "startsWith(matrix.os , 'macos')"
run: |
mkdir -p build-sanitize && cd -- "$_"
cmake -G Ninja -DLIBRAPIDARCHIVE_WITH_ISAL=OFF -DLIBRAPIDARCHIVE_USE_SYSTEM_ZLIB=OFF \
-DCMAKE_BUILD_TYPE=Sanitize -DCMAKE_CXX_FLAGS="-DSHORT_TESTS" ..
cmake --build . -- check
- name: Run Tests With Sanitizers
if: "startsWith(matrix.os , 'ubuntu')"
run: |
mkdir -p build-sanitize && cd -- "$_"
CXX=clang++ CC=clang cmake -G Ninja -DCMAKE_BUILD_TYPE=Sanitize ..
cmake --build . -- check
cmake --build .
bash ../src/tests/testRapidgzip.sh
Safe-Stack:
name: Safe-Stack
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-26.04
- ubuntu-26.04-arm
- macos-26
- macos-26-intel
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Install System Dependencies
if: "startsWith(matrix.os , 'macos')"
run: |
brew install -q ninja pigz zlib isa-l wget nasm gcc
wget 'https://github.com/samtools/htslib/releases/download/1.20/htslib-1.20.tar.bz2'
tar -xf htslib-1.20.tar.bz2
cd htslib* && ./configure --prefix="$PWD/installed" && make install
echo PATH="$PWD/installed/bin:$PATH" >> "${GITHUB_ENV}"
- name: Install System Dependencies
if: "startsWith(matrix.os , 'ubuntu')"
run: |
sudo apt update
sudo apt-get -y install clang g++ ninja-build gzip tabix pigz gztool libarchive-dev zlib1g-dev isal nasm
- name: Fix pip
run: |
echo "PIP_BREAK_SYSTEM_PACKAGES=1" >> "${GITHUB_ENV}"
- name: Install Python Dependencies
run: |
python3 -m pip install --upgrade pip || true # Fails on macOS because of homebrew
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Sanitizers
if: "startsWith(matrix.os , 'macos')"
run: |
sanitizer=address
mkdir -p "build-sanitized-$sanitizer" && cd -- "$_"
CXX=g++ CC=gcc cmake -G Ninja -DLIBRAPIDARCHIVE_WITH_ISAL=OFF -DLIBRAPIDARCHIVE_USE_SYSTEM_ZLIB=OFF -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-fsanitize=$sanitizer" -DCMAKE_CXX_FLAGS="-fsanitize=$sanitizer -DSHORT_TESTS" ..
cmake --build . -- testParallelGzipReader
src/tests/rapidgzip/testParallelGzipReader
- name: Run Tests With Sanitizers
if: "startsWith(matrix.os , 'ubuntu')"
run: |
sanitizer=safe-stack
mkdir -p "build-sanitized-$sanitizer" && cd -- "$_"
CXX=clang++ CC=clang cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-fsanitize=$sanitizer" -DCMAKE_CXX_FLAGS="-fsanitize=$sanitizer -DSHORT_TESTS" ..
cmake --build . -- check
TSan:
name: TSan
env:
TSAN_OPTIONS: halt_on_error=1
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Fix pip
run: |
echo "PIP_BREAK_SYSTEM_PACKAGES=1" >> "${GITHUB_ENV}"
- name: Install Dependencies
run: |
sudo apt update
sudo apt-get -y install clang g++ ninja-build gzip tabix pigz gztool libarchive-dev zlib1g-dev isal nasm
python3 -m pip install --upgrade pip || true # Fails on macOS because of homebrew
python3 -m pip install --upgrade-strategy eager --upgrade indexed_gzip pgzip
- name: Run Tests With Thread Sanitizer
run: |
sanitized=thread
mkdir -p "build-sanitized-$sanitized" && cd -- "$_"
#
# TSAN in clang 10 and 11 shows false positives in condition variables:
# https://github.com/google/sanitizers/issues/1259
# Similar false positives appear with GCC 10.
# NO warnings appear with: GCC 8, 9 and clang 12,
# so I'm pretty sure that these are the referenced false positives.
clangMajorVersion=$( clang++ --version | sed -n -E 's|.* ([0-9]+)[.][0-9]+[.][0-9]+.*|\1|p' | head -1 )
if [[ ( "$sanitized" == thread ) && ( "$clangMajorVersion" -le 11 ) ]]; then
g++ --version
gccMajorVersion=$( g++ --version | sed -n -E 's|.* ([0-9]+)[.][0-9]+[.][0-9]+.*|\1|p' | head -1 )
if [[ "$gccMajorVersion" -ge 10 ]]; then
echo "Could not find a compiler version without known false positives. Skipping TSAN."
continue
fi
CXX=g++
CC=gcc
else
CXX=clang++
CC=clang
fi
export CC CXX
#
cmake -G Ninja -DCMAKE_BUILD_TYPE=ThreadSanitize -DCMAKE_CXX_FLAGS="-DSHORT_TESTS" ..
cmake --build . -- check
Code-Checks:
name: Check with Infer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Install Dependencies
run: |
sudo apt update
sudo apt-get -y install ninja-build wget nasm cmake clang
- name: Install infer
run: |
VERSION=1.1.0
wget -q -O- "https://github.com/facebook/infer/releases/download/v1.2.0/infer-linux-x86_64-v1.2.0.tar.xz" | tar -xJ
realpath -- "$( find . -maxdepth 1 -type d -iname 'infer*' )"/bin >> "$GITHUB_PATH"
- name: Run infer
run: |
mkdir -p build-compile-commands && cd -- "$_"
CC=clang CXX=clang++ cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
infer run --no-progress-bar --report-block-list-path-regex '/usr/include/.*' --report-block-list-path-regex '.*testParallelBitStringFinder.cpp' --report-block-list-path-regex '.*/external/.*' --compilation-database compile_commands.json
cat infer-out/report.txt
Ibzip2-Tests:
name: Ibzip2 Tests
# And especially without -DSHORT_TESTS, which makes it non redundant to the sanitizer checks!
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-26.04
- ubuntu-26.04-arm
- macos-26
- macos-26-intel
- windows-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
submodules: recursive
- name: Install System Dependencies
if: "startsWith(matrix.os , 'macos')"
run: |
brew install -q ninja
- name: Install System Dependencies
if: "startsWith(matrix.os , 'ubuntu')"
run: |
sudo apt update
sudo apt-get -y install g++ ninja-build
- name: Fix pip
if: "startsWith(matrix.os , 'macos')"
run: |
mkdir -p "$HOME/Library/Application Support/pip"
cat <<EOF >> "$HOME/Library/Application Support/pip/pip.conf"
[global]
break-system-packages = true
EOF
- name: Fix pip
run: |
echo "PIP_BREAK_SYSTEM_PACKAGES=1" >> "${GITHUB_ENV}"
- name: Install Python Dependencies
run: |
python3 -m pip install --upgrade pip || true # Fails on macOS because of homebrew
python3 -m pip install build
- name: Install indexed_bzip2
working-directory: python/indexed_bzip2
shell: bash
run: |
python3 -m build
python3 -m pip install dist/*.tar.gz
- name: Run Standard Tests
shell: bash
# At this step, indexed_bzip2 should be installed.
run: |
mkdir -p build-ibzip2 && cd -- "$_"
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DLIBRAPIDARCHIVE_WITH_ISAL=OFF ..
cmake --build . -- ibzip2
set -o pipefail
bash ../src/tests/testIbzip2.sh | tee run-standard-tests.log
if grep -i 'failed' run-standard-tests.log; then
echo -e '\e[31mThere were errors while running the tests!\e[0m'
exit 1
fi