|
| 1 | +name: build-wheels-hipo |
| 2 | + |
| 3 | +on: [push] |
| 4 | +# on: [pull_request] |
| 5 | + |
| 6 | +concurrency: |
| 7 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 8 | + cancel-in-progress: true |
| 9 | + |
| 10 | +jobs: |
| 11 | + build_sdist: |
| 12 | + name: Build source distribution |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Build sdist |
| 18 | + shell: bash |
| 19 | + run: pipx run build --sdist |
| 20 | + |
| 21 | + - name: check metadata |
| 22 | + run: pipx run twine check dist/* |
| 23 | + |
| 24 | + build_wheels: |
| 25 | + name: Build HiPO wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} |
| 26 | + runs-on: ${{ matrix.buildplat[0] }} |
| 27 | + strategy: |
| 28 | + # Ensure that a wheel builder finishes even if another fails |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + # From NumPy |
| 32 | + # Github Actions doesn't support pairing matrix values together, let's improvise |
| 33 | + # https://github.com/github/feedback/discussions/7835#discussioncomment-1769026 |
| 34 | + buildplat: |
| 35 | + - [ubuntu-24.04, manylinux_x86_64] |
| 36 | + - [ubuntu-24.04, manylinux_i686] |
| 37 | + - [ubuntu-24.04-arm, manylinux_aarch64] |
| 38 | + - [ubuntu-24.04, musllinux_x86_64] # No OpenBlas, no test |
| 39 | + - [ubuntu-24.04, musllinux_i686] |
| 40 | + - [ubuntu-24.04-arm, musllinux_aarch64] |
| 41 | + - [macos-15-intel, macosx_x86_64] |
| 42 | + - [macos-14, macosx_arm64] |
| 43 | + - [windows-2022, win_amd64] |
| 44 | + - [windows-2022, win32] |
| 45 | + python: ["cp38", "cp39","cp310", "cp311","cp312", "cp313"] |
| 46 | + |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v4 |
| 49 | + |
| 50 | + # - name: Edit pyproject.toml (macOS) |
| 51 | + # if: runner.os == 'macOS' |
| 52 | + # shell: bash |
| 53 | + # run: | |
| 54 | + # # macOS sed requires a backup extension (here, an empty string '') |
| 55 | + # sed -i '' '/cmake\.args = \[/,/\]/{ |
| 56 | + # s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ |
| 57 | + # "-DHIPO=ON"| |
| 58 | + # }' pyproject.toml |
| 59 | + # echo "--- pyproject.toml content after macOS edit ---" |
| 60 | + # cat pyproject.toml |
| 61 | + |
| 62 | + # - name: Edit pyproject.toml (Linux) |
| 63 | + # if: runner.os == 'Linux' |
| 64 | + # shell: bash |
| 65 | + # run: | |
| 66 | + # # Linux sed does NOT require a backup extension |
| 67 | + # sed -i '/cmake\.args = \[/,/\]/{ |
| 68 | + # s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\ |
| 69 | + # "-DHIPO=ON",\ |
| 70 | + # "-DBUILD_OPENBLAS=ON"| |
| 71 | + # }' pyproject.toml |
| 72 | + # echo "--- pyproject.toml content after Linux edit ---" |
| 73 | + # cat pyproject.toml |
| 74 | + |
| 75 | + # - name: Edit pyproject.toml (Windows) |
| 76 | + # if: runner.os == 'Windows' |
| 77 | + # shell: pwsh |
| 78 | + # run: | |
| 79 | + # $content = Get-Content pyproject.toml -Raw |
| 80 | + # $newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @" |
| 81 | + # cmake.args = [ |
| 82 | + # "-DPYTHON_BUILD_SETUP=ON", |
| 83 | + # "-DHIPO=ON", |
| 84 | + # "-DBUILD_OPENBLAS=ON" |
| 85 | + # ] |
| 86 | + # "@ |
| 87 | + # $newContent | Set-Content pyproject.toml |
| 88 | + # cat pyproject.toml |
| 89 | + |
| 90 | + - name: Build wheels |
| 91 | + uses: pypa/cibuildwheel@v3.0 |
| 92 | + env: |
| 93 | + CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }} |
| 94 | + CIBW_TEST_COMMAND: "pytest {project}/tests {project}/check/test_highspy_hipo.py" |
| 95 | + CIBW_TEST_REQUIRES: "pytest" |
| 96 | + CIBW_BUILD_TAG: "apache" |
| 97 | + CIBW_CONFIG_SETTINGS_LINUX: "cmake.define.HIPO=ON cmake.define.BUILD_OPENBLAS=ON" |
| 98 | + CIBW_CONFIG_SETTINGS_MACOS: "cmake.define.HIPO=ON" |
| 99 | + CIBW_CONFIG_SETTINGS_WINDOWS: "cmake.define.HIPO=ON cmake.define.BUILD_OPENBLAS=ON" |
| 100 | + |
0 commit comments