diff --git a/.github/workflows/local.yml b/.github/workflows/local.yml index 9c267f5..5c74ab7 100644 --- a/.github/workflows/local.yml +++ b/.github/workflows/local.yml @@ -39,6 +39,7 @@ jobs: python-version: "3.12" - run: pip install pyvista - run: python tests/test_pyvista.py + - run: python -c "import pyvista;print(pyvista.Report())" - uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-${{ matrix.qt }}-sphere diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store diff --git a/action.yml b/action.yml index b5b04bd..bc89842 100644 --- a/action.yml +++ b/action.yml @@ -55,14 +55,10 @@ runs: mesa-utils \ x11-utils - - name: Install Windows GL Dependencies + - name: Install OpenGL on Windows if: runner.os == 'Windows' shell: cmd - run: | - Set-StrictMode -Version Latest - $ErrorActionPreference = "Stop" - $PSDefaultParameterValues['*:ErrorAction']='Stop' - powershell ${{ github.action_path }}/windows/install_opengl.ps1 + run: bash ${{ github.action_path }}\windows\install_opengl.sh - name: Configure headless display on Linux if: runner.os == 'Linux' diff --git a/windows/install_opengl.ps1 b/windows/install_opengl.ps1 deleted file mode 100644 index 84b5521..0000000 --- a/windows/install_opengl.ps1 +++ /dev/null @@ -1,51 +0,0 @@ -# Sample script to install Python and pip under Windows -# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner -# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/ - -# Adapted from VisPy - -$MESA_GL_URL = "https://github.com/vispy/demo-data/raw/main/mesa/" - -# Mesa DLLs found linked from: -# http://qt-project.org/wiki/Cross-compiling-Mesa-for-Windows -# to: -# http://sourceforge.net/projects/msys2/files/REPOS/MINGW/x86_64/mingw-w64-x86_64-mesa-10.2.4-1-any.pkg.tar.xz/download - -function DownloadMesaOpenGL ($architecture) { - [Net.ServicePointManager]::SecurityProtocol = 'Tls, Tls11, Tls12' - $webclient = New-Object System.Net.WebClient - # Download and retry up to 3 times in case of network transient errors. - $url = $MESA_GL_URL + "opengl32_mingw_" + $architecture + ".dll" - if ($architecture -eq "32") { - $filepath = "C:\Windows\SysWOW64\opengl32.dll" - } else { - $filepath = "C:\Windows\system32\opengl32.dll" - } - takeown /F $filepath /A - icacls $filepath /grant "${env:ComputerName}\${env:UserName}:F" - Remove-item -LiteralPath $filepath - Write-Host "Downloading" $url - $retry_attempts = 2 - for($i=0; $i -lt $retry_attempts; $i++){ - try { - $webclient.DownloadFile($url, $filepath) - break - } - Catch [Exception]{ - Start-Sleep 1 - } - } - if (Test-Path $filepath) { - Write-Host "File saved at" $filepath - } else { - # Retry once to get the error message if any at the last try - $webclient.DownloadFile($url, $filepath) - } -} - - -function main () { - DownloadMesaOpenGL "64" -} - -main diff --git a/windows/install_opengl.sh b/windows/install_opengl.sh new file mode 100755 index 0000000..f201e5f --- /dev/null +++ b/windows/install_opengl.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -exo pipefail +ls -alt /C/Windows/System32/opengl32.dll +VER="24.2.7" +NAME="mesa3d-${VER}-release-msvc" +curl -LO https://github.com/pal1000/mesa-dist-win/releases/download/${VER}/${NAME}.7z +7z x ${NAME}.7z -o./${NAME} +mv -v ${NAME}/x64/* /C/Windows/System32/ +rm -Rf ${NAME} +# takeown "/f" "C:\Windows\System32\opengl32.dll" +# icacls "C:\Windows\System32\opengl32.dll" /grant "$USERNAME:F" +ls -alt /C/Windows/System32/opengl32.dll