Build Pip Wheels #418
Workflow file for this run
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
name: Build Pip Wheels | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
env: | |
VCPKG-VERSION: '2024.10.21' | |
CUDA-VERSION: '11.4.2.47141' | |
CUDA-MAJOR: '11' | |
CUDA-MINOR: '4' | |
jobs: | |
setup: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
outputs: | |
version_tag: ${{ steps.get-latest-tag.outputs.tag }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions-ecosystem/action-get-latest-tag@v1 | |
if: ${{ github.event_name == 'release' }} | |
id: get-latest-tag | |
manylinux-pip-build: | |
needs: setup | |
timeout-minutes: 80 | |
runs-on: ${{ matrix.runner }} | |
container: | |
image: ${{ matrix.docker-image }} | |
options: ${{ matrix.container-options }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: ["x86_64", "aarch64"] | |
py-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
include: | |
- platform: "x86_64" | |
docker-image: "meshlib/meshlib-ubuntu20:latest" | |
container-options: "--user root" | |
runner: ubuntu-latest | |
compiler: /usr/bin/clang++-11 | |
- platform: "aarch64" | |
docker-image: "meshlib/meshlib-ubuntu20-arm64:latest" | |
container-options: "--user root" | |
runner: [ 'self-hosted', 'linux-arm64' ] | |
# When using Clang 11 on Ubuntu Arm 20.04, we get some obscure ABI issues that fail some tests, | |
# see the comments in `test_regression/test_algorithms/test_decimate.py` for more details. | |
compiler: /usr/bin/clang++-18 | |
- py-version: "3.8" | |
py-tag: "cp38" | |
py-cmd: "python3.8" | |
- py-version: "3.9" | |
py-tag: "cp39" | |
py-cmd: "python3.9" | |
- py-version: "3.10" | |
py-tag: "cp310" | |
py-cmd: "python3.10" | |
- py-version: "3.11" | |
py-tag: "cp311" | |
py-cmd: "python3.11" | |
- py-version: "3.12" | |
py-tag: "cp312" | |
py-cmd: "python3.12" | |
steps: | |
- name: Work-around possible permission issues | |
shell: bash | |
run: | | |
# NOTE: {GITHUB_WORKSPACE} != {{ github.workspace }} | |
# Related issue: https://github.com/actions/runner/issues/2058 | |
if test -d $GITHUB_WORKSPACE && test -n "$(find ${GITHUB_WORKSPACE} -user root)" ; then | |
mv ${GITHUB_WORKSPACE} ${GITHUB_WORKSPACE}_${RANDOM} | |
mkdir ${GITHUB_WORKSPACE} | |
fi | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{needs.setup.outputs.version_tag}} | |
- name: Checkout third-party submodules | |
# Some of those safe.directory rules could be redudant. | |
run: | | |
# have to checkout selective submodules by our own | |
# related issue: https://github.com/actions/checkout/issues/1779 | |
export HOME=${RUNNER_TEMP} | |
echo ${GITHUB_WORKSPACE} | |
git config --global --add safe.directory ${GITHUB_WORKSPACE} | |
git config --global --add safe.directory ${GITHUB_WORKSPACE}/thirdparty/imgui | |
git config --global --add safe.directory ${GITHUB_WORKSPACE}/thirdparty/parallel-hashmap | |
git submodule update --init --depth 1 thirdparty/imgui thirdparty/parallel-hashmap | |
- name: Python setup | |
if: ${{ matrix.py-version != '3.8' }} | |
run: | | |
apt -y update && apt -y upgrade && apt -y install software-properties-common | |
add-apt-repository -y ppa:deadsnakes/ppa && apt -y install ${{ matrix.py-cmd }}-dev | |
- name: Pip setup | |
run: | | |
curl -sS https://bootstrap.pypa.io/get-pip.py | ${{ matrix.py-cmd }} | |
${{ matrix.py-cmd }} -m pip install --upgrade -r ./requirements/python.txt | |
${{ matrix.py-cmd }} -m pip install pytest | |
- name: Install thirdparty libs | |
# Also print the amount of RAM. If there's not enough RAM, building MRBind bindings can fail. Not doing it in that step, because OOM fails can erase logs from the current step. | |
run: | | |
ln -s /usr/local/lib/meshlib-thirdparty-lib/lib ./lib | |
ln -s /usr/local/lib/meshlib-thirdparty-lib/include ./include | |
./scripts/mrbind/install_mrbind_ubuntu.sh | |
free -h | |
- name: Build | |
run: ./scripts/build_source.sh | |
env: | |
MESHLIB_PYTHON_VERSION: ${{matrix.py-version}} | |
MESHLIB_BUILD_RELEASE: "ON" | |
MESHLIB_BUILD_DEBUG: "OFF" | |
# When using Clang 11 on Ubuntu Arm 20.04, we get some obscure ABI issues that fail some tests, | |
# see the comments in `test_regression/test_algorithms/test_decimate.py` for more details. | |
CMAKE_CXX_COMPILER: ${{matrix.compiler}} | |
# FIXME: OpenGL libraries are included to wheel packages when the XDE module is used | |
# Disabling CUDA at least because Clang 18 is too new for it on Ubuntu 20.04, and we're using Clang 18 for reasons | |
# explained in `MeshLib/scripts/mrbind/0001-Disable-tests-that-seem-to-expose-an-ABI-incompatibility.patch`. | |
MR_CMAKE_OPTIONS: > | |
-DMRIOEXTRAS_OPENCASCADE_USE_XDE=OFF | |
-DMRVIEWER_NO_GTK=ON | |
-DMESHLIB_BUILD_MRCUDA=OFF | |
- name: Generate and build MRBind bindings | |
run: | | |
make -f scripts/mrbind/generate.mk -B --trace FOR_WHEEL=1 PYTHON_PKGCONF_NAME=python-${{matrix.py-version}}-embed CXX_FOR_ABI=${{matrix.compiler}} | |
- name: Run Tests | |
run: MR_LOCAL_RESOURCES=1 xvfb-run -a ./build/Release/bin/MeshViewer -hidden -noEventLoop -unloadPluginsAtEnd | |
- name: Unit Tests | |
run: build/Release/bin/MRTest | |
- name: Python Tests | |
working-directory: ./build/Release/bin | |
run: ${{ matrix.py-cmd }} ./../../../scripts/run_python_test_script.py -cmd ${{ matrix.py-cmd }} | |
- name: Create and fix Wheel | |
run: | | |
${{ matrix.py-cmd }} ./scripts/wheel/build_wheel.py --version ${{needs.setup.outputs.version_tag}} | |
- name: Upload Python Stubs | |
if: ${{ matrix.platform == 'aarch64' && matrix.py-version == '3.10' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: PythonStubs | |
path: ./scripts/wheel/meshlib/meshlib/*.pyi | |
retention-days: 1 | |
- name: Upload to Test Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ManyLinux-${{matrix.py-cmd}}-${{matrix.platform}} | |
path: ./scripts/wheel/meshlib/wheelhouse/meshlib-*.whl | |
retention-days: 1 | |
update-documentation: | |
needs: | |
- manylinux-pip-build | |
uses: ./.github/workflows/update-docs.yml | |
with: | |
output_folder: MeshLib | |
secrets: inherit | |
windows-pip-build: | |
needs: setup | |
timeout-minutes: 90 | |
runs-on: windows-2019 | |
strategy: | |
fail-fast: false | |
matrix: | |
py-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
include: | |
- py-version: "3.8" | |
py-tag: "cp38" | |
py-short-version: "38" | |
py-dir: "Python38" | |
py-file: "python38" | |
embed-version: "3.8.9" | |
- py-version: "3.9" | |
py-tag: "cp39" | |
py-short-version: "39" | |
py-dir: "Python39" | |
py-file: "python39" | |
embed-version: "3.9.9" | |
- py-version: "3.10" | |
py-tag: "cp310" | |
py-short-version: "310" | |
py-dir: "Python310" | |
py-file: "python310" | |
embed-version: "3.10.0" | |
- py-version: "3.11" | |
py-tag: "cp311" | |
py-short-version: "311" | |
py-dir: "Python311" | |
py-file: "python311" | |
embed-version: "3.11.0" | |
- py-version: "3.12" | |
py-tag: "cp312" | |
py-short-version: "312" | |
py-dir: "Python312" | |
py-file: "python312" | |
embed-version: "3.12.0" | |
permissions: | |
id-token: write # This is required for requesting the JWT | |
contents: read # This is required for actions/checkout | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
ref: ${{needs.setup.outputs.version_tag}} | |
- name: Checkout Vcpkg ${{env.VCPKG-VERSION}} | |
working-directory: C:\vcpkg | |
run: | | |
git fetch | |
git checkout ${{env.VCPKG-VERSION}} | |
- name: Restore Vcpkg Cache | |
uses: actions/cache@v4 | |
id: vcpkg-cache | |
with: | |
key: vcpkg-cache-${{env.VCPKG-VERSION}} | |
path: | | |
C:\vcpkg\* | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: arn:aws:iam::259351611210:role/GitHubMeshLibAwsCredsRole | |
aws-region: us-east-1 | |
- name: Update vcpkg packages | |
run: | | |
.\thirdparty\install.bat --write-s3 | |
- name: Vcpkg integrate install | |
working-directory: C:\vcpkg | |
run: C:\vcpkg\vcpkg.exe integrate install | |
- uses: actions/setup-python@v5 | |
id: setup-python | |
with: | |
python-version: ${{matrix.py-version}} | |
- name: Setup python | |
working-directory: C:\vcpkg\installed\x64-windows-meshlib | |
run: | | |
py -${{matrix.py-version}} -m pip install --upgrade pip | |
py -${{matrix.py-version}} -m pip install --upgrade -r ${{ github.workspace }}\requirements\python.txt | |
py -${{matrix.py-version}} -m pip install pytest | |
- name: Setup thirdparty | |
working-directory: ${{ github.workspace }}\thirdparty\python | |
run: | | |
curl https://www.python.org/ftp/python/${{matrix.embed-version}}/python-${{matrix.embed-version}}-embed-amd64.zip --output python-embed.zip | |
tar -xf python-embed.zip ${{matrix.py-file}}.zip | |
- name: Restore CUDA Cache | |
uses: actions/cache@v4 | |
id: cuda-cache | |
with: | |
key: cuda-${{env.CUDA-VERSION}} | |
path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA* | |
- name: Install CUDA | |
if: steps.cuda-cache.outputs.cache-hit != 'true' | |
run: choco install cuda --version=${{env.CUDA-VERSION}} --confirm | |
- name: Setup CUDA | |
shell: bash | |
run: | | |
echo "CUDA_PATH=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${{ env.CUDA-MAJOR }}.${{ env.CUDA-MINOR }}" >> $GITHUB_ENV | |
echo "CUDA_PATH_V${{ env.CUDA-MAJOR }}_${{ env.CUDA-MINOR }}=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${{ env.CUDA-MAJOR }}.${{ env.CUDA-MINOR }}" >> $GITHUB_ENV | |
echo "CUDA_PATH_VX_Y=CUDA_PATH_V${{ env.CUDA-MAJOR }}_${{ env.CUDA-MINOR }}" >> $GITHUB_ENV | |
echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${{ env.CUDA-MAJOR }}.${{ env.CUDA-MINOR }}\\bin" >> $GITHUB_PATH | |
- name: Install Visual Studio Integration | |
run: | | |
$x = (dir $env:CUDA_PATH -dir -recurse -depth 2).where({$_.name -eq 'visual_studio_integration'}).fullname | |
$y = (dir $x -dir -recurse).where({$_.name -eq 'MSBuildExtensions'}).fullname + '\*' | |
(gi 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\*\BuildCustomizations').fullname.foreach({cp $y $_}) | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Build | |
run: msbuild -m source\MeshLib.sln -p:Configuration=Release -p:PythonVersion=${{matrix.py-short-version}} -p:PythonLibPath=c:\hostedtoolcache\windows\python\${{steps.setup-python.outputs.python-version}}\x64\libs\${{matrix.py-file}}.lib -p:PythonDllPath=c:\hostedtoolcache\windows\python\${{steps.setup-python.outputs.python-version}}\x64\${{matrix.py-file}}.dll -p:PythonIncludePath=c:\hostedtoolcache\windows\python\${{steps.setup-python.outputs.python-version}}\x64\include\ | |
# Install MSYS2 using their github action instead of ours `install_deps_windows_msys2.bat`. Locally users should use that bat file. | |
# I'm expecting the official action to be better suited for CI needs (e.g. they promise some form of caching in the readme), but I didn't perform a proper comparison. | |
- name: Install MSYS2 for MRBind | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: clang64 | |
install: make gawk procps-ng mingw-w64-clang-x86_64-cmake | |
location: C:\msys64_meshlib_mrbind | |
- name: Install Clang in MSYS2 | |
shell: msys2 {0} | |
run: | | |
./scripts/mrbind/msys2_install_clang_ver.sh $(cat scripts/mrbind/clang_version_msys2.txt) | |
- name: Build MRBind | |
shell: cmd | |
env: | |
# Need this env variable because our .bat files assume msys2 installed directly to `C:\msys64_meshlib_mrbind`, | |
# and the setup-msys2 action always adds the `...\msys64` component at the end, and it's a tiny bit wasteful to move it around when running in the CI. | |
MSYS2_DIR: C:\msys64_meshlib_mrbind\msys64 | |
run: call ./scripts/mrbind/install_mrbind_windows_msys2.bat | |
- name: Generate and build MRBind bindings | |
shell: cmd | |
env: | |
MSYS2_DIR: C:\msys64_meshlib_mrbind\msys64 | |
# Note that `\` doesn't work here as a line continuation, and will lead to weird errors. | |
run: | | |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 | |
call ./scripts/mrbind/generate_win.bat -B --trace FOR_WHEEL=1 PYTHON_PKGCONF_NAME= PYTHON_CFLAGS=-IC:/hostedtoolcache/windows/python/${{steps.setup-python.outputs.python-version}}/x64/include PYTHON_LDFLAGS="-LC:/hostedtoolcache/windows/python/${{steps.setup-python.outputs.python-version}}/x64/libs -l${{matrix.py-file}}" | |
- name: Run Test | |
working-directory: source\x64\Release | |
run: .\MeshViewer.exe -tryHidden -noEventLoop | |
- name: Unit Tests | |
run: py -${{matrix.py-version}} scripts\run_unit_test_script.py Release | |
- name: Python Tests | |
working-directory: source\x64\Release | |
run: py -${{matrix.py-version}} ..\..\..\scripts\run_python_test_script.py -cmd "py -${{matrix.py-version}}" | |
- name: Create and fix Wheel | |
run: | | |
py -${{matrix.py-version}} .\scripts\wheel\build_wheel.py --plat-name=win-amd64 --version ${{needs.setup.outputs.version_tag}} | |
- name: Upload to Test Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Windows-python${{ matrix.py-version }} | |
path: wheelhouse\meshlib-*.whl | |
retention-days: 1 | |
macos-pip-build: | |
needs: setup | |
timeout-minutes: 80 | |
runs-on: ${{ matrix.instance }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: ["x86", "arm64"] | |
py-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
exclude: # python 3.8 disabled on x86 macOS since 2024-10-14 | |
- platform: "x86" | |
py-version: "3.8" | |
include: | |
- platform: "x86" | |
# On 12.0 x86 `brew` doesn't have binary packages for Clang. | |
plat-name: macosx_13_0_x86_64 | |
instance: macos-13 | |
brewpath: /usr/local | |
- platform: "arm64" | |
plat-name: macosx_12_0_arm64 | |
instance: macos-arm-build | |
brewpath: /opt/homebrew | |
- py-version: "3.8" | |
py-tag: "cp38" | |
py-cmd: "python3.8" | |
- py-version: "3.9" | |
py-tag: "cp39" | |
py-cmd: "python3.9" | |
- py-version: "3.10" | |
py-tag: "cp310" | |
py-cmd: "python3.10" | |
- py-version: "3.11" | |
py-tag: "cp311" | |
py-cmd: "python3.11" | |
- py-version: "3.12" | |
py-tag: "cp312" | |
py-cmd: "python3.12" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
ref: ${{needs.setup.outputs.version_tag}} | |
- name: Fix links x86 | |
if: ${{ matrix.platform == 'x86' }} | |
run: | | |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete | |
sudo rm -rf /Library/Frameworks/Python.framework/ | |
brew install --force python@${{ matrix.py-version }} && brew unlink python@${{ matrix.py-version }} && brew unlink python@${{ matrix.py-version }} && brew link --overwrite python@${{ matrix.py-version }} | |
- name: Fix links ARM | |
if: ${{ matrix.platform == 'arm64' }} | |
run: | | |
find /opt/homebrew/bin -lname '*/Library/Frameworks/Python.framework/*' -delete | |
rm -rf /Library/Frameworks/Python.framework/ | |
brew install --force python@${{ matrix.py-version }} && brew unlink python@${{ matrix.py-version }} && brew unlink python@${{ matrix.py-version }} && brew link --overwrite python@${{ matrix.py-version }} | |
- name: Create virtualenv | |
run: | | |
# Remove from PATH anything with the word `anaconda` in it. | |
# Even if Anaconda's Python works, it's probably a good idea to avoid it for consistency (because without this line only one specific Python version gets taken from Anaconda.) | |
export PATH="$(echo "$PATH" | perl -pe 's/[^:]*anaconda[^:]*//g;s/::|^:|:$//g')" | |
${{ matrix.py-cmd }} -m venv .venv | |
. .venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
- name: Python setup | |
run: | | |
curl -sS https://bootstrap.pypa.io/get-pip.py | ${{ matrix.py-cmd }} | |
${{ matrix.py-cmd }} -m pip install --upgrade -r ./requirements/python.txt | |
${{ matrix.py-cmd }} -m pip install pytest | |
${{ matrix.py-cmd }} -m pip uninstall -y meshlib | |
- name: Install thirdparty libs | |
run: | | |
./scripts/build_thirdparty.sh | |
./scripts/mrbind/install_deps_macos.sh | |
./scripts/mrbind/install_mrbind_macos.sh | |
- name: Build | |
run: ./scripts/build_source.sh | |
env: | |
MESHLIB_PYTHON_VERSION: ${{matrix.py-version}} | |
MESHLIB_BUILD_RELEASE: "ON" | |
MESHLIB_BUILD_DEBUG: "OFF" | |
CMAKE_CXX_COMPILER: /usr/bin/clang++ | |
MR_CMAKE_OPTIONS: > | |
-DMRVIEWER_NO_GTK=ON | |
# not realy needed | |
CMAKE_C_COMPILER: /usr/bin/clang | |
- name: Generate and build MRBind bindings | |
env: | |
PATH: ${{matrix.brewpath}}/opt/make/libexec/gnubin:${{matrix.brewpath}}/opt/grep/libexec/gnubin:${{env.PATH}} | |
# `MACOS_MIN_VER` picked arbitrarily to match what Apple Clang uses when building MeshLib. | |
# Not setting this or setting a different value cases a warning when linking the bindings, and you can get the correct (?) value from those warnings. | |
run: | | |
make --version | |
make -f scripts/mrbind/generate.mk -B --trace FOR_WHEEL=1 MACOS_MIN_VER=12.7 PYTHON_PKGCONF_NAME=python-${{matrix.py-version}}-embed EXTRA_CFLAGS='-DMB_PB11_ALLOW_STD_EXPECTED=0 -DMR_USE_STD_EXPECTED=0' | |
- name: Unit Tests | |
run: build/Release/bin/MRTest | |
- name: Python Tests | |
working-directory: ./build/Release/bin | |
run: ${{ matrix.py-cmd }} ./../../../scripts/run_python_test_script.py -cmd ${{ matrix.py-cmd }} | |
- name: Create and fix Wheel | |
run: | | |
${{ matrix.py-cmd }} ./scripts/wheel/build_wheel.py --plat-name=${{matrix.plat-name}} --version ${{needs.setup.outputs.version_tag}} | |
- name: Upload to Test Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Macos-${{matrix.py-cmd}}-${{matrix.platform}} | |
path: meshlib-*.whl | |
retention-days: 1 | |
manylinux-pip-test: | |
needs: [manylinux-pip-build] | |
timeout-minutes: 20 | |
runs-on: ${{ matrix.runner }} | |
container: | |
image: ${{matrix.container-prefix}}${{matrix.os}} | |
options: ${{ matrix.container-options }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: ["x86_64", "aarch64"] | |
os: ["ubuntu:20.04", "ubuntu:22.04", "debian:11-slim", "fedora:37", "fedora:39"] | |
include: | |
- platform: "x86_64" | |
runner: ubuntu-latest | |
container-options: "--user root" | |
container-prefix: " " | |
- platform: "aarch64" | |
runner: [ 'self-hosted', 'linux-arm64' ] | |
container-options: "--user root" | |
container-prefix: "arm64v8/" | |
- os: "ubuntu:20.04" | |
py-version: "3.8" | |
py-cmd: "python3.8" | |
- os: "debian:11-slim" | |
py-version: "3.9" | |
py-cmd: "python3.9" | |
- os: "ubuntu:22.04" | |
py-version: "3.10" | |
py-cmd: "python3.10" | |
- os: "fedora:37" | |
py-version: "3.11" | |
py-cmd: "python3.11" | |
- os: "fedora:39" | |
py-version: "3.12" | |
py-cmd: "python3.12" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{needs.setup.outputs.version_tag}} | |
- name: Ubuntu system setup | |
if: ${{ matrix.os == 'ubuntu:20.04' || matrix.os == 'ubuntu:22.04' || matrix.os == 'debian:11-slim' }} | |
run: apt -y update && apt -y upgrade && apt -y install curl libssl-dev python3-pip | |
- name: Fedora 37 system setup | |
if: ${{matrix.os == 'fedora:37' || matrix.os == 'fedora:39'}} | |
run: dnf -y install python3 pip | |
- name: Pip setup | |
run: | | |
${{ matrix.py-cmd }} -m pip install --upgrade pip | |
${{ matrix.py-cmd }} -m pip uninstall -y meshlib | |
${{ matrix.py-cmd }} -m pip install --upgrade -r ./requirements/python.txt | |
${{ matrix.py-cmd }} -m pip install pytest | |
- name: Download Meshlib wheel from Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ManyLinux-${{matrix.py-cmd}}-${{matrix.platform}} | |
merge-multiple: true | |
- name: Meshlib wheel install | |
run: ${{ matrix.py-cmd }} -m pip install ${{ matrix.pip-options }} ./meshlib-*.whl | |
- name: Run Python tests | |
working-directory: test_python | |
run: ${{ matrix.py-cmd }} -m pytest -s -v | |
windows-pip-test: | |
needs: [windows-pip-build] | |
timeout-minutes: 20 | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
py-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{needs.setup.outputs.version_tag}} | |
- name: Download Meshlib wheel from Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Windows-python${{matrix.py-version}} | |
merge-multiple: true | |
- name: Python setup | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.py-version }} | |
- name: Setup pip | |
run: | | |
py -${{matrix.py-version}} -m pip install --upgrade pip | |
py -${{matrix.py-version}} -m pip uninstall -y meshlib | |
py -${{matrix.py-version}} -m pip install --upgrade -r ./requirements/python.txt | |
py -${{matrix.py-version}} -m pip install pytest | |
- name: Install Meshlib wheel | |
shell: pwsh | |
run: $wheel_file=Get-ChildItem -Filter meshlib*win*.whl; py -${{matrix.py-version}} -m pip install $wheel_file | |
- name: Run Python tests | |
working-directory: test_python | |
run: py -${{matrix.py-version}} -m pytest -s -v | |
macos-pip-test: | |
needs: [macos-pip-build] | |
timeout-minutes: 20 | |
runs-on: ${{ matrix.instance }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: ["arm64", "x86"] | |
py-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
exclude: # python 3.8 disabled on x86 macOS since 2024-10-14 | |
- platform: "x86" | |
py-version: "3.8" | |
include: | |
- platform: "x86" | |
# On 12.0 x86 `brew` doesn't have binary packages for Clang. | |
plat-name: macosx_13_0_x86_64 | |
instance: macos-13 | |
- platform: "arm64" | |
plat-name: macosx_12_0_arm64 | |
instance: macos-arm-build | |
- py-version: "3.8" | |
py-cmd: "python3.8" | |
- py-version: "3.9" | |
py-cmd: "python3.9" | |
- py-version: "3.10" | |
py-cmd: "python3.10" | |
- py-version: "3.11" | |
py-cmd: "python3.11" | |
- py-version: "3.12" | |
py-cmd: "python3.12" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{needs.setup.outputs.version_tag}} | |
- name: Python setup | |
if: ${{ !(matrix.platform == 'x86' && ( matrix.py-version == '3.11' || matrix.py-version == '3.12' ) ) }} | |
run: brew install python@${{matrix.py-version}} | |
- name: Create virtualenv | |
run: | | |
# Remove from PATH anything with the word `anaconda` in it. | |
# Even if Anaconda's Python works, it's probably a good idea to avoid it for consistency (because without this line only one specific Python version gets taken from Anaconda.) | |
export PATH="$(echo "$PATH" | perl -pe 's/[^:]*anaconda[^:]*//g;s/::|^:|:$//g')" | |
${{ matrix.py-cmd }} -m venv .venv | |
. .venv/bin/activate | |
echo PATH=$PATH >> $GITHUB_ENV | |
- name: Pip setup | |
run: | | |
${{ matrix.py-cmd }} -m pip install --upgrade pip | |
${{ matrix.py-cmd }} -m pip uninstall -y meshlib | |
${{ matrix.py-cmd }} -m pip install --upgrade -r ./requirements/python.txt | |
${{ matrix.py-cmd }} -m pip install pytest | |
- name: Download Meshlib wheel from Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Macos-${{matrix.py-cmd}}-${{matrix.platform}} | |
merge-multiple: true | |
- name: Meshlib wheel install | |
run: ${{ matrix.py-cmd }} -m pip install ${{ matrix.pip-options }} ./meshlib-*${{matrix.platform}}*.whl | |
- name: Run Python tests | |
working-directory: test_python | |
run: ${{ matrix.py-cmd }} -m pytest -s -v | |
upload-to-release: | |
if: ${{ github.event_name == 'release' }} | |
needs: [manylinux-pip-test, windows-pip-test, macos-pip-test] | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Wheels Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: ManyLinux-* | |
merge-multiple: true | |
- name: Download Wheels Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: Windows-* | |
merge-multiple: true | |
- name: Download Wheels Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: Macos-* | |
merge-multiple: true | |
- name: Install twine | |
run: python3 -m pip install --upgrade pip twine | |
- name: Upload to Production PyPi | |
run: twine upload ./meshlib-*.whl -u __token__ -p ${{ secrets.PYPI_MESHINSPECTOR_TOKEN }} --skip-existing | |
post-release-test: | |
if: ${{ github.event_name == 'release' }} | |
needs: upload-to-release | |
uses: MeshInspector/MeshLib/.github/workflows/release-tests.yml@master | |
delete-artifacts: | |
timeout-minutes: 5 | |
runs-on: ubuntu-20.04 | |
needs: upload-to-release | |
if: always() | |
steps: | |
- name: Delete all ManyLinux | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: ManyLinux-* | |
failOnError: false | |
- name: Delete Python Stubs | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: PythonStubs | |
failOnError: false | |
- name: Delete all Windows | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: Windows-* | |
failOnError: false | |
- name: Delete all Macos | |
uses: geekyeggo/delete-artifact@v5 | |
with: | |
name: Macos-* | |
failOnError: false |