-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
114 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Python wheels | ||
|
||
# TODO: use sscache to speed up this workflow | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
|
||
# 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' | ||
|
||
# TODO: We are currently building wheels for master, it should be possible to select a tag | ||
- name: Checkout f3d | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: 'f3d-app/f3d' | ||
ref: 'master' | ||
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: Escaping backslashes Windows | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
run: echo "ESCAPED_WS=${{github.workspace}}" | tr '\\' '/' >> $GITHUB_ENV | ||
|
||
- 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_SKIP: '*-musl*' | ||
# TODO: cross-compile ARM too | ||
CIBW_ARCHS: native | ||
CIBW_BUILD_VERBOSITY: 1 | ||
CIBW_ENVIRONMENT: > | ||
CMAKE_PREFIX_PATH=../f3d-superbuild-build/install | ||
SKBUILD_CMAKE_ARGS=" | ||
-DF3D_DEPENDENCIES_DIR=${{ env.ESCAPED_WS }}/f3d-superbuild-build/install/bin; | ||
-DF3D_PLUGIN_BUILD_ALEMBIC=ON; | ||
-DF3D_PLUGIN_BUILD_ASSIMP=ON; | ||
-DF3D_PLUGIN_BUILD_DRACO=ON; | ||
-DF3D_PLUGIN_BUILD_OCCT=ON; | ||
-DF3D_PLUGIN_OCCT_COLORING_SUPPORT=ON; | ||
-DF3D_MODULE_EXR=ON; | ||
-DF3D_MODULE_EXTERNAL_RENDERING=ON" | ||
CIBW_ENVIRONMENT_PASS_LINUX: > | ||
CMAKE_PREFIX_PATH | ||
SKBUILD_CMAKE_ARGS | ||
CIBW_REPAIR_WHEEL_COMMAND: '' | ||
CIBW_BEFORE_ALL: > | ||
cmake -S f3d-superbuild -B f3d-superbuild-build | ||
-DBUILD_SHARED_LIBS=OFF | ||
-DCMAKE_BUILD_TYPE=Release | ||
-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=ON | ||
-DENABLE_vtk=ON | ||
-DOCCT_ENABLE_COLORING=ON | ||
-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 |
This file contains 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
This file contains 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