Skip to content

Commit

Permalink
Add Python wheels CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk committed Jul 9, 2023
1 parent a617085 commit e15a0be
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 5 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Python wheels

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, windows-2019, macOS-11]

# fetch-depth: 0 is required to get the tags used to determine f3d version
steps:
- name: Checkout f3d-superbuild
uses: actions/checkout@v3
with:
submodules: true
path: 'f3d-superbuild'

- name: Checkout f3d
uses: actions/checkout@v3
with:
repository: 'Meakk/f3d'
ref: 'python'
fetch-depth: 0
path: 'f3d'

- name: Recover VTK version to build
working-directory: ${{github.workspace}}
shell: bash
run: |
echo VTK_COMMIT_SHA=`cat ./f3d/.github/actions/vtk_commit_sha` >> $GITHUB_ENV
- name: Setup Ninja Windows
if: runner.os == 'Windows'
shell: bash
run: |
choco install ninja
echo CMAKE_GENERATOR=Ninja >> $GITHUB_ENV
- name: Setup MSVC Windows
if: runner.os == 'Windows'
uses: TheMrMilchmann/setup-msvc-dev@v2
with:
arch: x64

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.13.1
with:
package-dir: ${{github.workspace}}/f3d
output-dir: ${{github.workspace}}/wheelhouse
config-file: ${{github.workspace}}/f3d/pyproject.toml
env:
CIBW_ARCHS_LINUX: x86_64 aarch64
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_WINDOWS: AMD64 ARM64
CIBW_ENVIRONMENT: CMAKE_PREFIX_PATH=../../../../f3d-superbuild-build/install
CIBW_ENVIRONMENT_PASS_LINUX: CMAKE_PREFIX_PATH
CIBW_BEFORE_ALL: >
cmake -S f3d-superbuild -B f3d-superbuild-build
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=OFF
-DENABLE_f3d=OFF
-DENABLE_alembic=ON
-DENABLE_assimp=ON
-DENABLE_draco=ON
-DENABLE_occt=ON
-DENABLE_openexr=ON
-DENABLE_ospray=OFF
-DENABLE_pybind11=ON
-DENABLE_tbb=OFF
-DENABLE_vtk=ON
-DOCCT_ENABLE_COLORING=OFF
-Dvtk_SOURCE_SELECTION=git
-Dvtk_GIT_TAG=${{ env.VTK_COMMIT_SHA }} &&
cmake --build f3d-superbuild-build
- uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}-wheels
path: ./wheelhouse/*.whl
10 changes: 5 additions & 5 deletions projects/vtk.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ if (UNIX)
endif ()
endif ()

set(vtk_smp_type "STDThread")
set(vtk_smp_enable_stdthread OFF)
set(vtk_smp_type "Sequential")
set(vtk_smp_enable_sequential OFF)
if (tbb_enabled)
set(vtk_smp_type "TBB")
else ()
set(vtk_smp_enable_stdthread ON)
set(vtk_smp_enable_sequential ON)
endif ()

superbuild_add_project(vtk
Expand Down Expand Up @@ -58,8 +58,8 @@ superbuild_add_project(vtk
-DVTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2=YES
-DVTK_MODULE_ENABLE_VTK_TestingCore=YES
-DVTK_OPENGL_HAS_EGL=${egl_enabled}
-DVTK_SMP_ENABLE_SEQUENTIAL=OFF
-DVTK_SMP_ENABLE_STDTHREAD=${vtk_smp_enable_stdthread}
-DVTK_SMP_ENABLE_SEQUENTIAL=${vtk_smp_enable_sequential}
-DVTK_SMP_ENABLE_STDTHREAD=OFF
-DVTK_SMP_ENABLE_TBB=${tbb_enabled}
-DVTK_SMP_IMPLEMENTATION_TYPE=${vtk_smp_type}
-DVTK_VERSIONED_INSTALL=OFF
Expand Down

0 comments on commit e15a0be

Please sign in to comment.