Skip to content

Commit a90106b

Browse files
authored
Merge pull request #405 from statisticalbiotechnology/claude/round-three
Claude/round three
2 parents a022781 + 4b4fed2 commit a90106b

176 files changed

Lines changed: 18986 additions & 9811 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/build.yml‎

Lines changed: 318 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,141 @@
11
name: Build
22

3-
on: [push, pull_request]
3+
# Runs for pull requests and for pushes to master. A branch without a pull
4+
# request is built with "Run workflow" (workflow_dispatch). A new push to a
5+
# pull request cancels the run of the previous one.
6+
on:
7+
push:
8+
branches: [master]
9+
pull_request:
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
14+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
15+
16+
# Compilers: the minimum is GCC 9 (std::filesystem without an extra
17+
# library; CMakeLists.txt refuses older ones), and GCC 11 for the fast
18+
# number conversions (std::to_chars and std::from_chars for double). The
19+
# jobs build with GCC 13 (ubuntu-latest), GCC 11 (almalinux:9), GCC 9
20+
# (minimum-compiler), AppleClang (macos-15) and Visual Studio 2022.
21+
#
22+
# Platforms: the jobs that end with the steps option_matrix,
23+
# matrix_hashes and the two uploads (Linux x86-64 and arm64, macOS arm64,
24+
# Windows) run tests/ci/option_matrix.sh and upload the hashes of its
25+
# outputs (matrix-hashes-<platform>, tests/ci/matrix_hashes.py) and, for
26+
# five days, the outputs (matrix-outputs-<platform>). The job
27+
# platform-differences prints what differs from Linux x86-64.
28+
29+
# Idle OpenMP threads sleep instead of spinning: the runners have few cores,
30+
# and spinning threads slow the tests down several times when the cores are
31+
# shared. The results do not depend on it.
32+
env:
33+
OMP_WAIT_POLICY: passive
434

535
jobs:
636
build-ubuntu:
737
runs-on: ubuntu-latest
838
steps:
939
- uses: actions/checkout@v6
1040
- name: preinstall
11-
run: sudo apt-get update
41+
run: sudo apt-get update
1242
- name: create_dirs
1343
run: mkdir -p ${{ github.workspace }}/release ${{ github.workspace }}/build
1444
- name: configure_and_make
1545
run: ./admin/builders/ubuntu64_build.sh -s ${{ github.workspace }}/.. -r ${{ github.workspace }}/release -b ${{ github.workspace }}/build
16-
- name: unit_tests
17-
run: cd ${{ github.workspace }}/build/percolator && make test
18-
- name: system_test
19-
run: cd ${{ github.workspace }}/build/percolator && sudo make install && make test-install
46+
- name: tests
47+
# unit tests and system tests, on the binaries of the build tree
48+
run: cd ${{ github.workspace }}/build/percolator && ctest --output-on-failure
49+
- name: golden_hashes
50+
# every output file of the option matrix must be byte for byte what
51+
# the manifest tests/ci/option_matrix.sha256 records; a commit that
52+
# changes results on purpose writes the manifest again with
53+
# tests/ci/check_golden.sh --update (see tests/ci/README.md)
54+
run: bash tests/ci/check_golden.sh --strict ${{ github.workspace }}/build/percolator ${{ github.workspace }}/build/golden
55+
- name: exit_status
56+
# exit status 1 and a message on bad input and on write errors
57+
run: bash tests/ci/exit_status.sh ${{ github.workspace }}/build/percolator ${{ github.workspace }}/build/exit_status
58+
- name: check_package
59+
# the .deb must declare its library dependencies and hold no test binary
60+
run: |
61+
deb=$(ls ${{ github.workspace }}/release/*.deb)
62+
dpkg-deb -f "$deb"
63+
contents=$(dpkg-deb -c "$deb")
64+
echo "$contents"
65+
depends=$(dpkg-deb -f "$deb" Depends)
66+
grep -q libgomp1 <<< "$depends"
67+
if grep -q gtest_unit <<< "$contents"; then exit 1; fi
68+
- name: option_matrix
69+
run: bash tests/ci/option_matrix.sh build/percolator matrix
70+
- name: matrix_hashes
71+
run: python3 tests/ci/matrix_hashes.py hash matrix > matrix/hashes.txt
72+
- name: upload_matrix_hashes
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: matrix-hashes-linux-x86_64
76+
path: matrix/hashes.txt
77+
- name: upload_matrix_outputs
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: matrix-outputs-linux-x86_64
81+
path: |
82+
matrix
83+
!matrix/inputs/**
84+
retention-days: 5
85+
86+
# arm64 Linux, built and tested on an arm64 runner. GCC contracts a*b+c
87+
# into a fused multiply-add there, so a printed digit can differ from
88+
# x86-64 (see platform-differences).
89+
build-ubuntu-arm64:
90+
runs-on: ubuntu-24.04-arm
91+
steps:
92+
- uses: actions/checkout@v6
93+
- name: configure
94+
run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
95+
- name: build
96+
run: cmake --build build -j 4
97+
- name: tests
98+
run: cd build && ctest --output-on-failure
99+
- name: option_matrix
100+
run: bash tests/ci/option_matrix.sh build matrix
101+
- name: matrix_hashes
102+
run: python3 tests/ci/matrix_hashes.py hash matrix > matrix/hashes.txt
103+
- name: upload_matrix_hashes
104+
uses: actions/upload-artifact@v4
105+
with:
106+
name: matrix-hashes-linux-arm64
107+
path: matrix/hashes.txt
108+
- name: upload_matrix_outputs
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: matrix-outputs-linux-arm64
112+
path: |
113+
matrix
114+
!matrix/inputs/**
115+
retention-days: 5
116+
117+
# The oldest supported compiler: GCC 9 on Ubuntu 20.04, where
118+
# std::to_chars and std::from_chars for double are missing and the slower
119+
# number conversions are used. Not blocking until it has passed once: no
120+
# GCC 9 was at hand when the job was written.
121+
minimum-compiler:
122+
runs-on: ubuntu-latest
123+
container: 'ubuntu:20.04'
124+
continue-on-error: true
125+
env:
126+
DEBIAN_FRONTEND: noninteractive
127+
steps:
128+
- name: preinstall
129+
run: apt-get update && apt-get install -y g++ cmake make git python3
130+
- uses: actions/checkout@v6
131+
- name: configure
132+
run: g++ --version && cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
133+
- name: build
134+
run: cmake --build build -j 4
135+
- name: tests
136+
run: cd build && ctest --output-on-failure
137+
- name: option_matrix
138+
run: bash tests/ci/option_matrix.sh build matrix
20139

21140
build-almalinux:
22141
runs-on: ubuntu-latest
@@ -27,8 +146,19 @@ jobs:
27146
run: mkdir -p ../my_rel ../my_build
28147
- name: configure_and_make
29148
run: ./admin/builders/centos64_build.sh -s `pwd`/.. -r `pwd`/../my_rel -b `pwd`/../my_build
30-
- name: unit_tests
31-
run: cd ../my_build/percolator && make test
149+
- name: tests
150+
run: cd ../my_build/percolator && ctest --output-on-failure
151+
- name: golden_hashes
152+
# another compiler and C library than the manifest was made with:
153+
# differences are listed, and the hashes uploaded, without failing
154+
run: bash tests/ci/check_golden.sh --report ../my_build/percolator golden
155+
- name: upload_hashes
156+
uses: actions/upload-artifact@v4
157+
with:
158+
name: golden-hashes-almalinux
159+
path: golden/hashes.sha256
160+
- name: exit_status
161+
run: bash tests/ci/exit_status.sh ../my_build/percolator exit_status
32162

33163
build-osx:
34164
runs-on: macos-15
@@ -38,10 +168,46 @@ jobs:
38168
run: mkdir -p ${{ github.workspace }}/release ${{ github.workspace }}/build
39169
- name: configure_and_make
40170
run: admin/builders/osx64_build.sh -s ${{ github.workspace }}/.. -r ${{ github.workspace }}/release -b ${{ github.workspace }}/build
41-
- name: unit_tests
42-
run: cd ${{ github.workspace }}/build/percolator && make test
43-
- name: system_test
44-
run: cd ${{ github.workspace }}/build/percolator && sudo make install && make test-install
171+
- name: tests
172+
run: cd ${{ github.workspace }}/build/percolator && ctest --output-on-failure
173+
- name: golden_hashes
174+
# the manifest was made on x86-64 Linux: differences are listed, and
175+
# the hashes uploaded, without failing
176+
run: bash tests/ci/check_golden.sh --report ${{ github.workspace }}/build/percolator ${{ github.workspace }}/build/golden
177+
- name: upload_hashes
178+
uses: actions/upload-artifact@v4
179+
with:
180+
name: golden-hashes-osx
181+
path: ${{ github.workspace }}/build/golden/hashes.sha256
182+
- name: exit_status
183+
run: bash tests/ci/exit_status.sh ${{ github.workspace }}/build/percolator ${{ github.workspace }}/build/exit_status
184+
- name: check_binary
185+
# minos must be 12.0 (CMAKE_OSX_DEPLOYMENT_TARGET); libomp should be
186+
# linked statically, so that the binary runs without Homebrew
187+
run: |
188+
bin=${{ github.workspace }}/build/percolator/src/percolator
189+
lipo -info "$bin"
190+
otool -l "$bin" | grep -A4 LC_BUILD_VERSION
191+
otool -L "$bin"
192+
minos=$(otool -l "$bin" | awk '/LC_BUILD_VERSION/ {f = 1} f && $1 == "minos" && !done {print $2; done = 1}')
193+
test "$minos" = "12.0"
194+
- name: option_matrix
195+
run: bash tests/ci/option_matrix.sh build/percolator matrix
196+
- name: matrix_hashes
197+
run: python3 tests/ci/matrix_hashes.py hash matrix > matrix/hashes.txt
198+
- name: upload_matrix_hashes
199+
uses: actions/upload-artifact@v4
200+
with:
201+
name: matrix-hashes-macos-arm64
202+
path: matrix/hashes.txt
203+
- name: upload_matrix_outputs
204+
uses: actions/upload-artifact@v4
205+
with:
206+
name: matrix-outputs-macos-arm64
207+
path: |
208+
matrix
209+
!matrix/inputs/**
210+
retention-days: 5
45211

46212
build-windows:
47213
runs-on: windows-2022
@@ -57,7 +223,143 @@ jobs:
57223
run: |
58224
echo %GITHUB_WORKSPACE%
59225
call "%GITHUB_WORKSPACE%\admin\builders\nativew64_build.bat" -s "%GITHUB_WORKSPACE%\.." -r "%GITHUB_WORKSPACE%\rel" -b "%GITHUB_WORKSPACE%\build"
60-
# - name: unit_tests
61-
# run: |
62-
# CD my_build\percolator
63-
# make test
226+
- name: tests
227+
# unit tests and system tests, on the binaries of the build tree
228+
run: |
229+
cd /D "%GITHUB_WORKSPACE%\build\percolator"
230+
for /f "tokens=2 delims==" %%i in ('findstr /b "CMAKE_CTEST_COMMAND:INTERNAL=" CMakeCache.txt') do set "CTEST=%%i"
231+
"%CTEST%" -C Release --output-on-failure
232+
- name: check_runtime_dlls
233+
# with the static C++ runtime, percolator.exe must not need the
234+
# Visual C++ Redistributable (only vcomp140.dll and system DLLs)
235+
run: |
236+
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do set "VSDIR=%%i"
237+
call "%VSDIR%\VC\Auxiliary\Build\vcvars64.bat" > nul || exit /b 1
238+
dumpbin /dependents "%GITHUB_WORKSPACE%\build\percolator\src\Release\percolator.exe" > deps.txt || exit /b 1
239+
type deps.txt
240+
findstr /i "msvcp140 vcruntime140" deps.txt > nul && (echo percolator.exe needs the Visual C++ runtime DLLs& exit /b 1)
241+
exit /b 0
242+
- name: option_matrix
243+
# with Git Bash, on build/percolator/src/Release/percolator.exe
244+
shell: bash
245+
env:
246+
PYTHON: python
247+
run: bash tests/ci/option_matrix.sh build/percolator matrix
248+
- name: matrix_hashes
249+
shell: bash
250+
run: python tests/ci/matrix_hashes.py hash matrix > matrix/hashes.txt
251+
- name: upload_matrix_hashes
252+
uses: actions/upload-artifact@v4
253+
with:
254+
name: matrix-hashes-windows-x86_64
255+
path: matrix/hashes.txt
256+
- name: upload_matrix_outputs
257+
uses: actions/upload-artifact@v4
258+
with:
259+
name: matrix-outputs-windows-x86_64
260+
path: |
261+
matrix
262+
!matrix/inputs/**
263+
retention-days: 5
264+
265+
# Prints the output files of the option matrix that differ between the
266+
# platforms, with their first differing lines. A report, not a check:
267+
# compilers and math libraries round differently (fused multiply-add on
268+
# arm64), which changes a printed digit now and then.
269+
platform-differences:
270+
needs: [build-ubuntu, build-ubuntu-arm64, build-osx, build-windows]
271+
if: ${{ !cancelled() }}
272+
runs-on: ubuntu-latest
273+
steps:
274+
- uses: actions/checkout@v6
275+
- uses: actions/download-artifact@v4
276+
with:
277+
pattern: matrix-outputs-*
278+
path: platforms
279+
- name: compare
280+
shell: bash
281+
run: |
282+
mkdir -p platforms && cd platforms
283+
reference=matrix-outputs-linux-x86_64
284+
if [ ! -d "$reference" ]; then
285+
echo "no outputs of Linux x86-64 to compare with"
286+
exit 0
287+
fi
288+
others=$(ls -d matrix-outputs-* | grep -v -x "$reference" || true)
289+
python3 ../tests/ci/matrix_hashes.py compare "$reference" $others | tee report.txt
290+
{ echo '```'; cat report.txt; echo '```'; } >> "$GITHUB_STEP_SUMMARY"
291+
292+
# ASan and UBSan over the unit tests, the system tests and a matrix of
293+
# option combinations (tests/ci/option_matrix.sh); any report fails the job.
294+
# The build keeps the assertions: CMake's RelWithDebInfo flags are
295+
# "-O2 -g -DNDEBUG", which the job replaces by "-O2 -g".
296+
sanitizers:
297+
runs-on: ubuntu-latest
298+
env:
299+
ASAN_OPTIONS: detect_leaks=1
300+
UBSAN_OPTIONS: print_stacktrace=1
301+
steps:
302+
- uses: actions/checkout@v6
303+
- name: preinstall
304+
# GCC 13's ASan fails at startup with the runners' high ASLR entropy
305+
run: sudo sysctl -w vm.mmap_rnd_bits=28
306+
- name: configure
307+
run: >
308+
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
309+
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer"
310+
-DCMAKE_C_FLAGS="-fsanitize=address,undefined -fno-sanitize-recover=all -fno-omit-frame-pointer"
311+
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined"
312+
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g"
313+
-DCMAKE_C_FLAGS_RELWITHDEBINFO="-O2 -g"
314+
- name: build
315+
run: cmake --build build -j 4
316+
- name: tests
317+
run: cd build && ctest --output-on-failure
318+
- name: option_matrix
319+
run: bash tests/ci/option_matrix.sh build build/option_matrix
320+
- name: exit_status
321+
# the error paths: bad input and write errors, without a report
322+
run: bash tests/ci/exit_status.sh build build/exit_status
323+
324+
# Results must not depend on the number of threads: the option matrix
325+
# with 1 and 4 threads must give byte-identical outputs. The job also
326+
# checks that configuring works without network access when GoogleTest
327+
# is installed.
328+
determinism:
329+
runs-on: ubuntu-latest
330+
steps:
331+
- uses: actions/checkout@v6
332+
- name: preinstall
333+
run: sudo apt-get update && sudo apt-get install -y libgtest-dev
334+
- name: configure_offline
335+
run: >
336+
HTTPS_PROXY=http://127.0.0.1:9 HTTP_PROXY=http://127.0.0.1:9
337+
https_proxy=http://127.0.0.1:9 http_proxy=http://127.0.0.1:9
338+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
339+
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
340+
- name: build
341+
run: cmake --build build -j 4
342+
- name: tests
343+
run: cd build && ctest --output-on-failure
344+
- name: thread_independence
345+
run: bash tests/ci/check_determinism.sh build build/determinism
346+
347+
# Blocking: percolator, qvality and the unit tests compile without a
348+
# warning of -Wall -Wextra. GoogleTest comes from the system, so its own
349+
# sources are not compiled here. A warning that cannot be fixed at once
350+
# may be allowed for a while by raising WARNING_BUDGET.
351+
warnings:
352+
runs-on: ubuntu-latest
353+
env:
354+
WARNING_BUDGET: 0
355+
steps:
356+
- uses: actions/checkout@v6
357+
- name: preinstall
358+
run: sudo apt-get update && sudo apt-get install -y libgtest-dev
359+
- name: build
360+
run: |
361+
set -o pipefail
362+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wall -Wextra"
363+
cmake --build build -j 4 2>&1 | tee build.log
364+
- name: count
365+
run: bash tests/ci/count_warnings.sh build.log "$WARNING_BUDGET"

‎.github/workflows/container.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
matrix:
1111
include:
1212
- name: percolator
13-
percolator_cmake_args: "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DGOOGLE_TEST=0 -DNO_TESTS=ON"
13+
percolator_cmake_args: "-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DNO_TESTS=ON"
1414
steps:
1515
- name: Checkout
1616
uses: actions/checkout@v6

0 commit comments

Comments
 (0)