Setup a headless display on Linux and Windows (not needed on MacOS)
- name: Setup headless display
uses: pyvista/setup-headless-display-action@v3
name: Tests that require virtual display
on:
pull_request:
workflow_dispatch:
push:
tags:
- "*"
branches:
- main
jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: pyvista/setup-headless-display-action@v3
qt
(defaultfalse
): set totrue
to install libraries required for Qt on Linux, e.g.:- uses: pyvista/setup-headless-display-action@v3 with: qt: true
pyvista
(defaulttrue
): set tofalse
if you don't want to set env vars to use PyVista in offscreen mode.
name: Workflow that uses PyVista for plotting
on:
pull_request:
workflow_dispatch:
push:
tags:
- "*"
branches:
- main
jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: pyvista/setup-headless-display-action@v3
- uses: actions/setup-python@v5
with:
python-version: 3.12
- run: pip install pyvista
- run: python -c "import pyvista;pyvista.Sphere().plot(screenshot='${{ matrix.os }}-sphere.png')"
- uses: actions/upload-artifact@v4
with:
name: sphere
path: ${{ matrix.os }}-sphere.png