Skip to content

Build and test windows wheels #421

Build and test windows wheels

Build and test windows wheels #421

Workflow file for this run

name: Build Wheels
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-2019]
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
name: Setup msys2
with:
update: true
install: >-
mingw-w64-ucrt-x86_64-gcc
autotools
# path-type inherit is used so that when cibuildwheel calls msys2 to
# run bin/cibw_before_build_windows.sh the virtual environment
# created by cibuildwheel will be available within msys2. The
# msys2/setup-msys2 README warns that using inherit here can be
# problematic in some situations. Maybe there is a better way to do
# this.
path-type: inherit
msystem: ucrt64
if: ${{ matrix.os == 'windows-2019' }}
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_SKIP: pp* *-win32
CIBW_BEFORE_BUILD: bash scripts/before_ci_build.sh
CIBW_BEFORE_ALL_WINDOWS: >
pip install delvewheel &&
msys2 -c scripts/before_ci_build.sh &&
call mingw64/dll2lib.bat 64 "D:\a\_temp\msys64\ucrt64\bin\libgmp-10.dll" gmp &&
call mingw64/dll2lib.bat 64 "D:\a\_temp\msys64\ucrt64\bin\libmpfr-6.dll" mpfr &&
call mingw64/dll2lib.bat 64 "D:\a\_temp\msys64\ucrt64\bin\libmpc-3.dll" mpc &&
msys2 -c scripts/repair_ci_wheel_windows.sh
CIBW_BEFORE_BUILD_WINDOWS: >
msys2 -c scripts/before_ci_build_windows.sh
CIBW_TEST_EXTRAS: tests
CIBW_TEST_COMMAND: >
pytest {package}/test/ &&
python {package}/test_cython/runtests.py
CIBW_TEST_COMMAND_WINDOWS: >
pytest {package}/test/
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >
cd "D:\a\_temp\msys64\ucrt64" &&
delvewheel repair {wheel} -w {dest_dir} --add-path bin --no-mangle-all &&
cd "D:\a\gmpy\gmpy" &&
msys2 -c scripts/repair_ci_wheel_windows.sh
CIBW_REPAIR_WHEEL_COMMAND_LINUX: >
bash scripts/repair_ci_wheel.sh {dest_dir} {wheel}
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
bash scripts/repair_ci_wheel.sh {dest_dir} {wheel} {delocate_archs}
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse
build_wheels_macos_arm64:
name: Build wheel on ${{ matrix.os }} arm64
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-12]
steps:
- uses: actions/checkout@v3
- name: Build wheel
uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BEFORE_BUILD: bash scripts/before_ci_build_apple_silicon.sh
CIBW_SKIP: pp*
CIBW_ARCHS_MACOS: arm64
CIBW_TEST_EXTRAS: tests
CIBW_TEST_COMMAND: >
pytest {package}/test/ &&
python {package}/test_cython/runtests.py
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
bash scripts/repair_ci_wheel.sh {dest_dir} {wheel} {delocate_archs}
- uses: actions/upload-artifact@v3
with:
name: wheels
path: ./wheelhouse