Skip to content

GitHub Action to setup a headless display on Linux and Windows (not needed on MacOS)

License

Notifications You must be signed in to change notification settings

tlambert03/setup-headless-display-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📺 Setup Headless Display Action

Setup a headless display on Linux and Windows (not needed on MacOS)

- name: Setup headless display
  uses: pyvista/setup-headless-display-action@v1

🚀 Usage

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:
      - name: Setup headless display
        uses: pyvista/setup-headless-display-action@v1

Options

  • qt (default false): set to true to install libraries required for Qt on Linux, e.g.:
        - uses: pyvista/setup-headless-display-action@v1
          with:
            qt: true
  • pyvista (default true): set to false if you don't want to set env vars to use PyVista in offscreen mode.

🖼️ PyVista Example

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:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup headless display
        uses: pyvista/setup-headless-display-action@v1

      - name: Setup Python
        uses: actions/setup-python@v1
        with:
          python-version: 3.9

      - name: Install PyVista
        run: pip install pyvista

      - name: Use PyVista
        run: python -c "import pyvista;pyvista.Sphere().plot(screenshot='${{ matrix.os }}-sphere.png')"

      - uses: actions/upload-artifact@v2
        with:
          name: sphere
          path: ${{ matrix.os }}-sphere.png

About

GitHub Action to setup a headless display on Linux and Windows (not needed on MacOS)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 66.6%
  • Python 23.6%
  • Shell 9.8%