Allow external adjustment of parallel search workers #208
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - 'release/**' | |
| permissions: | |
| contents: read | |
| env: | |
| # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
| BUILD_TYPE: Release | |
| jobs: | |
| tidy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Tidy checks | |
| shell: bash | |
| run: uv run misc/tidy.py --check | |
| build-autoconf: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-15, ubuntu-latest] | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Install Ubuntu build deps | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flex bison libgmp-dev libmpfr-dev | |
| - name: Install generated-source tools | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: | | |
| # The freshness helper bootstraps the pinned Autoconf version itself. | |
| brew install m4 bison flex | |
| - name: Check generated source freshness | |
| if: runner.os == 'macOS' | |
| shell: bash | |
| run: bash .github/ci/generated-source-freshness.sh | |
| - name: Avoid redundant configure regeneration during build | |
| shell: bash | |
| run: touch configure | |
| - name: Configure | |
| shell: bash | |
| run: ./configure | |
| - name: Build | |
| shell: bash | |
| run: make test -j4 | |
| - name: Check | |
| shell: bash | |
| run: make check | |
| - name: Autoconf install smoke | |
| shell: bash | |
| run: bash .github/ci/autoconf-install-smoke.sh "$RUNNER_TEMP/gecode-autoconf-install" | |
| - name: Custom VIS dependency smoke | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: bash .github/ci/custom-vis-smoke.sh | |
| build-cmake-unix: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: macos-15 | |
| regenerate_varimp: OFF | |
| - os: ubuntu-latest | |
| regenerate_varimp: ON | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Install Ubuntu build deps | |
| if: runner.os == 'Linux' | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flex bison libgmp-dev libmpfr-dev | |
| - name: Create Build Environment | |
| run: cmake -E make_directory ${{github.workspace}}/build | |
| - name: Configure CMake | |
| shell: bash | |
| working-directory: ${{github.workspace}}/build | |
| run: | | |
| set -euxo pipefail | |
| cmake_args=( | |
| "$GITHUB_WORKSPACE" | |
| "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" | |
| "-DGECODE_REGENERATE_VARIMP=${{ matrix.regenerate_varimp }}" | |
| ) | |
| if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | |
| # Keep this path absolute to validate package config handling for absolute install dirs. | |
| cmake_args+=( | |
| "-DCMAKE_INSTALL_INCLUDEDIR=/tmp/gecode-install-abs-include" | |
| "-DGECODE_ENABLE_FAULT_INJECTION=ON" | |
| ) | |
| fi | |
| cmake "${cmake_args[@]}" | |
| - name: Build | |
| working-directory: ${{github.workspace}}/build | |
| shell: bash | |
| run: cmake --build . --config $BUILD_TYPE | |
| - name: Check | |
| working-directory: ${{github.workspace}}/build | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| cmake --build . --config $BUILD_TYPE --target check | |
| - name: Install CMake package | |
| working-directory: ${{github.workspace}}/build | |
| shell: bash | |
| run: cmake --install . --config $BUILD_TYPE --prefix "$GITHUB_WORKSPACE/install" | |
| - name: Consumer smoke tests | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| if [ "${{ matrix.os }}" = "ubuntu-latest" ]; then | |
| bash .github/ci/cmake-consumer-smoke.sh \ | |
| "$GITHUB_WORKSPACE/install" \ | |
| "/tmp/gecode-install-abs-include" \ | |
| mpfr | |
| else | |
| bash .github/ci/cmake-consumer-smoke.sh \ | |
| "$GITHUB_WORKSPACE/install" \ | |
| "$GITHUB_WORKSPACE/install/include" \ | |
| core | |
| fi | |
| - name: Package version checks | |
| shell: bash | |
| run: bash .github/ci/cmake-package-version-checks.sh "$GITHUB_WORKSPACE/install" | |
| - name: Disabled module closure checks | |
| if: matrix.os == 'ubuntu-latest' | |
| shell: bash | |
| run: bash .github/ci/cmake-closure-checks.sh | |
| - name: CMake custom VIS checks | |
| if: matrix.os == 'ubuntu-latest' | |
| shell: bash | |
| run: bash .github/ci/cmake-custom-vis-smoke.sh | |
| - name: Gist static macro compatibility | |
| if: matrix.os == 'ubuntu-latest' | |
| shell: bash | |
| run: bash .github/ci/gist-static-macro-smoke.sh | |
| - name: Qt minimum version checks | |
| if: matrix.os == 'ubuntu-latest' | |
| shell: bash | |
| run: bash .github/ci/qt-minimum-version-checks.sh | |
| build-cmake-unix-ninja: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Install build deps | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flex bison libgmp-dev libmpfr-dev ninja-build | |
| - name: Configure CMake with Ninja | |
| shell: bash | |
| run: > | |
| cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build-ninja" | |
| -G Ninja | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| -DGECODE_ENABLE_QT=OFF | |
| -DGECODE_ENABLE_GIST=OFF | |
| -DGECODE_ENABLE_MPFR=OFF | |
| - name: Build | |
| shell: bash | |
| run: cmake --build "$GITHUB_WORKSPACE/build-ninja" | |
| - name: Example feature selection | |
| shell: bash | |
| run: bash .github/ci/cmake-example-feature-smoke.sh | |
| - name: Check | |
| shell: bash | |
| run: > | |
| ctest --test-dir "$GITHUB_WORKSPACE/build-ninja" | |
| --output-on-failure -R '^(build-gecode-test|test)$' | |
| - name: Configure CMake Debug audit smoke | |
| shell: bash | |
| run: > | |
| cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build-ninja-debug" | |
| -G Ninja | |
| -DCMAKE_BUILD_TYPE=Debug | |
| -DGECODE_ENABLE_AUDIT=ON | |
| -DGECODE_ENABLE_QT=OFF | |
| -DGECODE_ENABLE_GIST=OFF | |
| -DGECODE_ENABLE_MPFR=OFF | |
| -DGECODE_ENABLE_EXAMPLES=OFF | |
| -DGECODE_ENABLE_FLATZINC=OFF | |
| - name: Build Debug audit smoke | |
| shell: bash | |
| run: cmake --build "$GITHUB_WORKSPACE/build-ninja-debug" | |
| - name: Install and smoke test FlatZinc tools | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| cmake --install "$GITHUB_WORKSPACE/build-ninja" --prefix "$GITHUB_WORKSPACE/install-ninja" | |
| bash .github/ci/flatzinc-tools-smoke.sh "$GITHUB_WORKSPACE/install-ninja" | |
| build-32-bit-linkage: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install 32-bit toolchain | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y g++-multilib | |
| - name: Build and link 32-bit stop consumer | |
| shell: bash | |
| run: bash .github/ci/32-bit-linkage-smoke.sh "$GITHUB_WORKSPACE" "$RUNNER_TEMP/gecode-32-bit-linkage" | |
| build-cmake-qt-gist: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Install Qt build deps | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flex bison qt6-base-dev qt6-base-dev-tools libgl1-mesa-dev | |
| - name: Configure CMake with Qt/Gist | |
| shell: bash | |
| run: > | |
| cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build-qt-gist" | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE | |
| -DGECODE_ENABLE_QT=ON | |
| -DGECODE_ENABLE_GIST=ON | |
| -DGECODE_ENABLE_MPFR=OFF | |
| -DGECODE_ENABLE_EXAMPLES=OFF | |
| -DGECODE_ENABLE_FLATZINC=ON | |
| - name: Build and install Qt/Gist package | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| cmake --build "$GITHUB_WORKSPACE/build-qt-gist" --config $BUILD_TYPE -j4 | |
| cmake --install "$GITHUB_WORKSPACE/build-qt-gist" --config $BUILD_TYPE --prefix "$GITHUB_WORKSPACE/install-qt-gist" | |
| - name: Qt/Gist consumer smoke test | |
| shell: bash | |
| run: bash .github/ci/qt-gist-consumer-smoke.sh "$GITHUB_WORKSPACE/install-qt-gist" | |
| build-cmake-qt5-gist-smoke: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Install Qt 5 build deps | |
| shell: bash | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y flex bison qtbase5-dev qtbase5-dev-tools libgl1-mesa-dev | |
| - name: Configure CMake with Qt 5/Gist | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| qt5_config="$(dpkg-query -L qtbase5-dev | grep '/Qt5Config.cmake$')" | |
| qt5_dir="${qt5_config%/*}" | |
| cmake -S "$GITHUB_WORKSPACE" -B "$GITHUB_WORKSPACE/build-qt5-gist" \ | |
| -DCMAKE_BUILD_TYPE="$BUILD_TYPE" \ | |
| -DQt5_DIR="$qt5_dir" \ | |
| -DGECODE_ENABLE_QT=ON \ | |
| -DGECODE_ENABLE_GIST=ON \ | |
| -DGECODE_ENABLE_MPFR=OFF \ | |
| -DGECODE_ENABLE_EXAMPLES=OFF \ | |
| -DGECODE_ENABLE_FLATZINC=OFF | |
| grep -Eq '^Qt5_DIR:[^=]*=.*/Qt5$' "$GITHUB_WORKSPACE/build-qt5-gist/CMakeCache.txt" | |
| grep -q '^Qt5Core_DIR:PATH=' "$GITHUB_WORKSPACE/build-qt5-gist/CMakeCache.txt" | |
| - name: Build and install Qt 5/Gist package | |
| shell: bash | |
| run: | | |
| set -euxo pipefail | |
| cmake --build "$GITHUB_WORKSPACE/build-qt5-gist" --config $BUILD_TYPE -j4 | |
| cmake --install "$GITHUB_WORKSPACE/build-qt5-gist" --config $BUILD_TYPE --prefix "$GITHUB_WORKSPACE/install-qt5-gist" | |
| - name: Qt 5/Gist consumer smoke test | |
| shell: bash | |
| run: bash .github/ci/qt5-gist-consumer-smoke.sh "$GITHUB_WORKSPACE/install-qt5-gist" | |
| build-cmake-windows: | |
| runs-on: windows-2022 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: shared | |
| build_shared: ON | |
| build_static: OFF | |
| - name: static | |
| build_shared: OFF | |
| build_static: ON | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Create Build Environment | |
| shell: pwsh | |
| run: cmake -E make_directory "${{ github.workspace }}\\build" | |
| - name: Configure CMake | |
| shell: pwsh | |
| run: > | |
| cmake -S "${{ github.workspace }}" -B "${{ github.workspace }}\\build" | |
| -G "Visual Studio 17 2022" -A x64 | |
| -DGECODE_ENABLE_QT=OFF | |
| -DGECODE_ENABLE_GIST=OFF | |
| -DGECODE_ENABLE_MPFR=OFF | |
| -DGECODE_BUILD_SHARED=${{ matrix.build_shared }} | |
| -DGECODE_BUILD_STATIC=${{ matrix.build_static }} | |
| - name: Build | |
| shell: pwsh | |
| run: cmake --build "${{ github.workspace }}\\build" --config ${{ env.BUILD_TYPE }} | |
| - name: Check | |
| shell: pwsh | |
| run: cmake --build "${{ github.workspace }}\\build" --config ${{ env.BUILD_TYPE }} --target check | |
| - name: Install CMake package | |
| shell: pwsh | |
| run: cmake --install "${{ github.workspace }}\\build" --config ${{ env.BUILD_TYPE }} --prefix "${{ github.workspace }}\\install" | |
| - name: Consumer smoke tests | |
| shell: pwsh | |
| run: .\.github\ci\cmake-consumer-smoke.ps1 "${{ github.workspace }}\install" | |
| build-cmake-windows-vcpkg: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Cache vcpkg binary packages | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4 | |
| with: | |
| path: ${{ runner.temp }}\vcpkg-binary-cache | |
| key: vcpkg-${{ runner.os }}-x64-windows-d015e31e90838a4c9dfa3eed45979bc70d9357fc-${{ hashFiles('vcpkg.json') }} | |
| restore-keys: | | |
| vcpkg-${{ runner.os }}-x64-windows-d015e31e90838a4c9dfa3eed45979bc70d9357fc- | |
| - name: Setup vcpkg | |
| shell: pwsh | |
| run: | | |
| $vcpkgRoot = Join-Path $env:RUNNER_TEMP "vcpkg" | |
| $vcpkgBinaryCache = Join-Path $env:RUNNER_TEMP "vcpkg-binary-cache" | |
| New-Item -ItemType Directory -Force -Path $vcpkgBinaryCache | Out-Null | |
| git clone https://github.com/microsoft/vcpkg $vcpkgRoot | |
| git -C $vcpkgRoot checkout d015e31e90838a4c9dfa3eed45979bc70d9357fc | |
| & (Join-Path $vcpkgRoot "bootstrap-vcpkg.bat") -disableMetrics | |
| "VCPKG_ROOT=$vcpkgRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| "VCPKG_DEFAULT_BINARY_CACHE=$vcpkgBinaryCache" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Configure CMake (preset) | |
| shell: pwsh | |
| run: cmake --preset vs2022-vcpkg | |
| - name: Build | |
| shell: pwsh | |
| run: cmake --build --preset vs2022-vcpkg-release | |
| - name: Check | |
| shell: pwsh | |
| run: cmake --build --preset vs2022-vcpkg-check | |
| - name: Install CMake package | |
| shell: pwsh | |
| run: cmake --install "${{ github.workspace }}\\build\\vs2022-vcpkg" --config ${{ env.BUILD_TYPE }} --prefix "${{ github.workspace }}\\install-vcpkg" | |
| - name: Consumer smoke tests | |
| shell: pwsh | |
| run: .\.github\ci\cmake-consumer-smoke-vcpkg.ps1 "${{ github.workspace }}\install-vcpkg" | |
| build-cmake-windows-msys2: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Setup MSYS2 | |
| uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c | |
| with: | |
| msystem: UCRT64 | |
| update: true | |
| install: >- | |
| mingw-w64-ucrt-x86_64-cmake | |
| mingw-w64-ucrt-x86_64-gcc | |
| mingw-w64-ucrt-x86_64-ninja | |
| - name: Configure CMake | |
| shell: msys2 {0} | |
| run: | | |
| workspace=$(cygpath -u "$GITHUB_WORKSPACE") | |
| cmake -S "$workspace" -B "$workspace/build-msys2" -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ | |
| -DGECODE_ENABLE_QT=OFF \ | |
| -DGECODE_ENABLE_GIST=OFF \ | |
| -DGECODE_ENABLE_MPFR=OFF \ | |
| -DGECODE_BUILD_SHARED=OFF \ | |
| -DGECODE_BUILD_STATIC=ON \ | |
| -DGECODE_ENABLE_EXAMPLES=OFF \ | |
| -DGECODE_ENABLE_FLATZINC=OFF | |
| - name: Build and install static package | |
| shell: msys2 {0} | |
| run: | | |
| workspace=$(cygpath -u "$GITHUB_WORKSPACE") | |
| cmake --build "$workspace/build-msys2" | |
| cmake --install "$workspace/build-msys2" --prefix "$workspace/install-msys2" | |
| - name: Static package consumer smoke | |
| shell: msys2 {0} | |
| run: | | |
| workspace=$(cygpath -u "$GITHUB_WORKSPACE") | |
| bash "$workspace/.github/ci/cmake-consumer-smoke-msys2.sh" "$workspace/install-msys2" | |
| build-autoconf-windows: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 | |
| with: | |
| enable-cache: false | |
| - name: Resolve uv path on Windows host | |
| shell: pwsh | |
| run: | | |
| $uvExe = (Get-Command uv -ErrorAction Stop).Source | |
| $uvDir = Split-Path -Parent $uvExe | |
| "UV_WIN_DIR=$uvDir" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Setup MSYS2 | |
| uses: msys2/setup-msys2@e9898307ac31d1a803454791be09ab9973336e1c | |
| with: | |
| msystem: UCRT64 | |
| update: true | |
| install: >- | |
| autoconf | |
| automake | |
| bison | |
| flex | |
| gcc | |
| make | |
| m4 | |
| libtool | |
| mingw-w64-ucrt-x86_64-gcc | |
| mingw-w64-ucrt-x86_64-gmp | |
| mingw-w64-ucrt-x86_64-mpfr | |
| - name: Verify uv in MSYS2 shell | |
| shell: msys2 {0} | |
| run: | | |
| UV_DIR="$(cygpath "$UV_WIN_DIR")" | |
| echo "UV_DIR=$UV_DIR" >> "$GITHUB_ENV" | |
| export PATH="$UV_DIR:$PATH" | |
| uv --version | |
| - name: Avoid redundant configure regeneration during build | |
| shell: msys2 {0} | |
| run: touch configure | |
| - name: Configure | |
| shell: msys2 {0} | |
| run: | | |
| export PATH="$UV_DIR:$PATH" | |
| CC=gcc CXX=g++ ./configure --with-host-os=Windows --disable-qt --disable-gist --disable-mpfr | |
| - name: Build | |
| shell: msys2 {0} | |
| run: | | |
| export PATH="$UV_DIR:$PATH" | |
| make test -j4 | |
| - name: Check | |
| shell: msys2 {0} | |
| run: | | |
| export PATH="$UV_DIR:$PATH" | |
| make check |