From 68fecfdc13f819f964b430d4d718e22f27b3d87f Mon Sep 17 00:00:00 2001 From: "Gabriel A. Devenyi" Date: Fri, 18 Sep 2026 22:25:16 -0400 Subject: [PATCH] COMP: Build the optional code paths in the per-PR workflow cmake-multi-platform.yml is the workflow that runs on every pull request, and it passes no options at all. With the defaults that means cifti/ and fsliolib/ are never compiled, and neither are the blocks behind FSLSTYLE, PIGZ and REJECT_COMPLEX. USE_CIFTI_CODE OFF USE_FSL_CODE OFF FSLSTYLE_NAME_CONFLICTS OFF -> -DFSLSTYLE FSLSTYLE_PIGZ_SUPPORT OFF -> -DPIGZ FSLSTYLE_REJECT_COMPLEX OFF -> -DREJECT_COMPLEX So a PR that changes any of those files collects four green checks that never built it. Several open PRs are in exactly that position. The matrix gains an 'options' axis: 'default' is what a consumer gets with no arguments, 'all' turns the optional libraries and the FSL parity defines on. Both are kept, because the default build is what ships and a change can break it while the fuller one still compiles. Four jobs become eight, each about half a minute. expat is installed for the Linux 'all' jobs; cifti needs it and the default jobs do not. Verified on master before writing this, with the test suite: default build OK, tests pass +cifti +fsl build OK, tests pass +cifti +fsl +FSLSTYLE build OK, tests pass, doPigz/doPigz2 present in nifti2_io.c.o COMPILE_NIFTIUNUSED_CODE is deliberately left out. It guards code the project itself labels unused, so compiling it in CI would commit to keeping it working; whether that code should exist at all is a separate question. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/cmake-multi-platform.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 4a19f9a3..1257c890 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -26,6 +26,10 @@ jobs: os: [ubuntu-latest, macos-latest] build_type: [Release] c_compiler: [gcc, clang] + # 'default' is what a consumer gets with no options; 'all' turns on + # the optional libraries and the FSL parity defines, which are the + # code paths no workflow compiled before. + options: [default, all] include: - os: macos-latest c_compiler: clang @@ -43,6 +47,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Install optional dependencies + # cifti needs expat; only the 'all' configuration builds it. + if: runner.os == 'Linux' && matrix.options == 'all' + run: sudo apt-get update && sudo apt-get install -y libexpat1-dev zlib1g-dev + - name: Set reusable strings # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. id: strings @@ -58,6 +67,7 @@ jobs: -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + ${{ matrix.options == 'all' && '-DUSE_CIFTI_CODE=ON -DUSE_FSL_CODE=ON -DFSLSTYLE=ON' || '' }} -S ${{ github.workspace }} - name: Build