Skip to content

workflow draft

workflow draft #594

name: Build and test Python wheels
# testing only should be commented out in the final version
on: [push, pull_request]
# this is the release version
#on:
# push:
# tags:
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build_wheels_unix:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
include:
- os: ubuntu-22.04
toolchain: gcc
arch_flags: "-march=x86-64" # probably -march=x86-64_v2 is safe
- os: macos-13
toolchain: llvm
arch_flags: "-mcpu=apple-m3"
- os: windows-2022
toolchain: llvm
arch_flags: "-march=x86-64_v2" # Windows11 requires avx2 so this should be fine
steps:
- uses: actions/checkout@v4
- name: Setup Cpp
uses: aminya/setup-cpp@v1
with:
compiler: ${{ matrix.toolchain }}
vcvarsall: ${{ contains(matrix.os, 'windows') }}
cmake: true
ninja: true
vcpkg: false
cppcheck: false
clangtidy: false
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel
- name: Build finufft wheels
run: |
python -m cibuildwheel --package-dir python/finufft --output-dir wheelhouse
env:
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET=13
CIBW_ARCHS_MACOS: "arm64"
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_BUILD_FRONTEND: "pip; args: \
-C cmake.define.CMAKE_BUILD_TYPE=Release \
-C cmake.define.FINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }} \
-C cmake.define.FINUFFT_USE_DUCC0=OFF \
-C cmake.define.CMAKE_GENERATOR=Ninja \
-C cmake.define.CMAKE_GENERATOR_PLATFORM="
CIBW_TEST_COMMAND: "echo 'No tests'"
- name: Install cuda
if: runner.os != 'macOS' # Skip this step on macOS
uses: Jimver/[email protected]
with:
cuda: '11.4.0'
- name: Build cufinufft wheels
if: runner.os != 'macOS' # Skip this step on macOS
uses: pypa/[email protected]
with:
package-dir: 'python/cufinufft'
output-dir: wheelhouse
env:
CIBW_ARCHS_MACOS: "arm64"
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_BUILD_FRONTEND: "pip; args: \
-C cmake.define.CMAKE_BUILD_TYPE=Release \
-C cmake.define.FINUFFT_ARCH_FLAGS=${{ matrix.arch_flags }} \
-C cmake.define.FINUFFT_USE_DUCC0=OFF \
-C cmake.define.CMAKE_GENERATOR=Ninja \
-C cmake.define.CMAKE_GENERATOR_PLATFORM="
CIBW_TEST_COMMAND: "echo 'No tests'"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl