Merge branch 'main' into devel #159
This file contains hidden or 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: BuildAndTest | |
| on: | |
| [push, pull_request] | |
| env: | |
| QT_VERSION: 5.15.2 | |
| jobs: | |
| build_pymeshlab: | |
| name: Build PyMeshLab | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pyversion: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| os: ['ubuntu-22.04', 'ubuntu-22.04-arm', 'macos-13', 'macos-latest', 'windows-latest'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup env variables | |
| id: envs | |
| shell: bash | |
| run: | | |
| echo "name=VCINSTALLDIR::C:\Program Files (x86)\Microsoft Visual Studio\2022\Enterprise\VC" >> $GITHUB_ENV | |
| ARCH=$(uname -m) | |
| echo "arch=$ARCH" >> $GITHUB_OUTPUT | |
| if [ "${{matrix.os}}" != "macos-latest" ]; then | |
| echo "build_options=--nightly --ccache" >> $GITHUB_OUTPUT | |
| echo "deploy_options=" >> $GITHUB_OUTPUT | |
| else | |
| echo "build_options=--nightly --ccache --use_brew_qt" >> $GITHUB_OUTPUT | |
| echo "deploy_options=--use_brew_qt" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Setup Windows MSVC | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Install Qt | |
| if: ${{ matrix.os != 'macos-latest' && matrix.os != 'ubuntu-22.04-arm' }} | |
| uses: jurplel/install-qt-action@v3 | |
| with: | |
| cache: true | |
| version: ${{ env.QT_VERSION }} | |
| - name: Install Python ${{ matrix.pyversion }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Install dependencies | |
| shell: bash | |
| run: | | |
| sh scripts/${{ runner.os }}/0_setup_env.sh | |
| - name: Install Brew Qt | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install qt@5 | |
| - name: Install apt qt | |
| if: matrix.os == 'ubuntu-22.04-arm' | |
| run: | | |
| sudo apt-get install qtbase5-dev qt5-qmake | |
| - name: Cache external libraries sources | |
| id: cache-ext-libs | |
| uses: actions/cache@v4 | |
| with: | |
| path: src/meshlab/src/external/downloads/* | |
| key: ${{ runner.os }}-external-libraries | |
| - name: Ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: ${{ runner.os }}-${{ github.ref }} | |
| - name: Build PyMeshLab ${{ matrix.pyversion }} | |
| run: | | |
| sh scripts/${{ runner.os }}/1_build.sh ${{ steps.envs.outputs.build_options }} | |
| - name: Deploy PyMeshLab ${{ matrix.pyversion }} | |
| run: | | |
| sh scripts/${{ runner.os }}/2_deploy.sh ${{ steps.envs.outputs.deploy_options }} | |
| - name: Sign PyMeshLab ${{ matrix.pyversion }} | |
| uses: cnr-isti-vclab/sign-and-notarize@v1 | |
| with: | |
| input-path: 'pymeshlab/*' | |
| macos-certificate: '${{ secrets.MACOS_CERTIFICATE }}' | |
| macos-certificate-id: '${{ secrets.MACOS_CERT_ID }}' | |
| macos-certificate-password: '${{ secrets.MACOS_CERTIFICATE_PSSW }}' | |
| - name: Upload PyMeshLab_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: PyMeshLab_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| path: pymeshlab | |
| build_wheel: | |
| name: Build PyMeshLab Wheel | |
| runs-on: ${{ matrix.os }} | |
| needs: build_pymeshlab | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pyversion: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| os: ['ubuntu-22.04', 'ubuntu-22.04-arm', 'macos-13', 'macos-latest', 'windows-latest'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup env variables | |
| id: envs | |
| shell: bash | |
| run: | | |
| ARCH=$(uname -m) | |
| echo "arch=$ARCH" >> $GITHUB_OUTPUT | |
| - name: Download PyMeshLab_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: PyMeshLab_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| path: pymeshlab/ | |
| - name: Install Python ${{ matrix.pyversion }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Build Wheel | |
| shell: bash | |
| run: | | |
| VER=$(date +%Y.%m.%d) | |
| echo "${VER}.dev0" | tr -d '\n'> PYML_VERSION | |
| pip install wheel | |
| pip wheel . -w wheels/ | |
| - name: Upload wheel ${{ runner.os }}_${{ steps.envs.outputs.arch }} python ${{ matrix.pyversion }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: pymeshlab_whl_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| path: wheels/pymeshlab*.whl | |
| test_pymeshlab: | |
| name: Test PyMeshLab | |
| runs-on: ${{ matrix.os }} | |
| needs: build_pymeshlab | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pyversion: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| os: ['ubuntu-latest', 'ubuntu-22.04-arm', 'macos-13', 'macos-latest', 'windows-latest'] | |
| steps: | |
| - name: Setup env variables | |
| id: envs | |
| shell: bash | |
| run: | | |
| ARCH=$(uname -m) | |
| echo "arch=$ARCH" >> $GITHUB_OUTPUT | |
| - name: Download PyMeshLab_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: PyMeshLab_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| path: pymeshlab/ | |
| - name: Install Python ${{ matrix.pyversion }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Install dependencies | |
| run: | | |
| pip install pytest numpy | |
| - name: Install linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get install libopengl0 | |
| - name: Set CPU opengl | |
| if: runner.os == 'Windows' | |
| run: | | |
| python -c 'import pymeshlab; pymeshlab.use_cpu_opengl()' #just for windows | |
| - name: Run tests | |
| run: | | |
| pytest --pyargs pymeshlab -m "not glcontext" | |
| #- name: Upload PyMeshLab results | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: PyMeshLabResults_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| # path: pymeshlab/tests/sample_meshes/test_output | |
| test_wheel: | |
| name: Test Wheel | |
| needs: build_wheel | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| pyversion: ['3.10', '3.11', '3.12', '3.13', '3.14'] | |
| os: ['ubuntu-latest', 'ubuntu-22.04-arm', 'macos-13', 'macos-latest', 'windows-latest'] | |
| steps: | |
| - name: Setup env variables | |
| id: envs | |
| shell: bash | |
| run: | | |
| ARCH=$(uname -m) | |
| echo "arch=$ARCH" >> $GITHUB_OUTPUT | |
| - name: Download pymeshlab_whl_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: pymeshlab_whl_${{ runner.os }}_${{ steps.envs.outputs.arch }}_python${{ matrix.pyversion }} | |
| path: . | |
| - name: Install Python ${{ matrix.pyversion }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.pyversion }} | |
| - name: Install wheel and dependencies | |
| shell: bash | |
| run: | | |
| pip install pytest numpy | |
| pip install pymeshlab*.whl | |
| - name: Install linux dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get install libopengl0 | |
| - name: Set CPU opengl | |
| if: runner.os == 'Windows' | |
| run: | | |
| python -c 'import pymeshlab; pymeshlab.use_cpu_opengl()' #just for windows | |
| - name: Run tests | |
| run: | | |
| pytest --pyargs pymeshlab -m "not glcontext" |