github auto test Linux headless Qt platform bug fix attempt 3 #129
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: CoperniFUS viewer | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest, windows-latest, ubuntu-latest] | |
| python-version: ['3.12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install FFTW via Homebrew | |
| # https://github.com/waltsims/k-wave-python/issues/549 | |
| if: runner.os == 'macos' | |
| run: | | |
| brew update | |
| brew install hdf5 fftw zlib libomp | |
| - name: "Install Windows-Mesa OpenGL DLL" | |
| if: runner.os == 'Windows' | |
| run: | | |
| curl -L --output mesa.7z --url https://github.com/pal1000/mesa-dist-win/releases/download/24.0.6/mesa3d-24.0.6-release-msvc.7z | |
| 7z x mesa.7z -o* | |
| powershell.exe mesa\systemwidedeploy.cmd 1 | |
| - name: "Install Linux system dependencies" | |
| if: runner.os == 'Linux' | |
| run: | | |
| # make sure universe is available (safe on GitHub runners) | |
| sudo apt-get update | |
| sudo apt-get install -y software-properties-common || true | |
| sudo add-apt-repository -y universe || true | |
| sudo apt-get update | |
| sudo apt-get install -y libxcb-cursor-dev | |
| - name: "Install Linux VirtualDisplay" | |
| if: runner.os == 'Linux' | |
| run: | | |
| # Install Mesa/OpenGL and Xvfb + required X/wayland compatibility libs | |
| sudo apt-get install -y --no-install-recommends \ | |
| libegl1-mesa \ | |
| libgl1-mesa-dri \ | |
| libglx-mesa0 \ | |
| libglu1-mesa \ | |
| libglvnd0 \ | |
| xvfb \ | |
| libxkbcommon-x11-0 \ | |
| libxcb-cursor0 \ | |
| libxcb-xinerama0 \ | |
| libxcb-render0 \ | |
| libxcb-shape0 \ | |
| libxcb-randr0 \ | |
| libxcb-icccm4 \ | |
| libxcb-image0 \ | |
| libxcb-keysyms1 \ | |
| libxcb-util1 \ | |
| libxrender1 \ | |
| libxi6 \ | |
| libxtst6 | |
| export QT_QPA_PLATFORM=offscreen | |
| - name: Installing CoperniFUS | |
| run: python -m pip install -e . | |
| - name: Installing test dependencies | |
| run: pip install pytest pytest-qt | |
| - name: "Display Info (Windows/MacOS)" | |
| if: runner.os != 'Linux' | |
| run: | | |
| python -m pyqtgraph.util.glinfo | |
| python -m pyqtgraph.util.get_resolution | |
| - name: "Display Info (Linux)" | |
| if: runner.os == 'Linux' | |
| run: | | |
| xvfb-run --auto-servernum --server-args="-screen 0 1920x1200x24" \ | |
| python -m pyqtgraph.util.glinfo | |
| python -m pyqtgraph.util.get_resolution | |
| - name: "Debug Info" | |
| run: | | |
| echo python location: `which python` | |
| echo python version: `python --version` | |
| echo pytest location: `which pytest` | |
| echo installed packages | |
| python -m pip list | |
| echo pyqtgraph system info | |
| python -c "import pyqtgraph as pg; pg.systemInfo()" | |
| shell: bash | |
| env: | |
| QT_DEBUG_PLUGINS: 1 | |
| - name: Download test BrainGlobe atlas | |
| run: brainglobe install -a example_mouse_100um | |
| - name: "Testing CoperniFUS (Windows/MacOS)" | |
| if: runner.os != 'Linux' | |
| run: pytest tests/test_viewer.py | |
| - name: "Testing CoperniFUS (Linux)" | |
| if: runner.os == 'Linux' | |
| run: | | |
| xvfb-run --auto-servernum --server-args="-screen 0 1920x1200x24" \ | |
| python -m pyqtgraph.util.glinfo | |
| xvfb-run --auto-servernum --server-args="-screen 0 1920x1200x24" \ | |
| pytest tests/test_viewer.py |