forked from pyvista/setup-headless-display-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
59 lines (53 loc) · 2.01 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: 'setup-headless-display-action'
description: 'Setup a headless display on Linux and Windows'
author: PyVista Developers'
inputs:
pyvista:
description: "Set PyVista env vars for headless mode"
required: false
default: true
qt:
description: "Install libraries required for Qt on Linux"
required: false
default: false
branding:
icon: 'monitor'
color: 'blue'
runs:
using: "composite"
steps:
- name: Install Linux dependencies
if: runner.os == 'Linux'
shell: bash
# TODO: Pyvista uses `xset` which is part of x11-xserver-utils, maybe a better way to check?
run: sudo apt update && sudo apt install libgl1-mesa-glx xvfb x11-xserver-utils -y
- name: Install Linux Qt dependencies
if: runner.os == 'Linux' && inputs.qt != 'false'
shell: bash
run: sudo apt install libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 libopengl0 libegl1 libosmesa6 mesa-utils libxcb-shape0 libxcb-cursor0
- name: Install Windows GL Dependencies
if: runner.os == 'Windows'
shell: cmd
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
$PSDefaultParameterValues['*:ErrorAction']='Stop'
powershell ${{ github.action_path }}/windows/install_opengl.ps1
- name: Configure headless display on Linux
if: runner.os == 'Linux'
shell: bash
run: |
export DISPLAY=:99.0
echo "DISPLAY=:99.0" >> $GITHUB_ENV
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 3
- name: Configure for PyVista on Linux and macOS
if: runner.os != 'Windows' && inputs.pyvista != 'false'
shell: bash
run: echo "PYVISTA_OFF_SCREEN=true" >> $GITHUB_ENV
- name: Configure for PyVista on Windows
if: runner.os == 'Windows' && inputs.pyvista != 'false'
shell: powershell
run: |
chcp 65001 #set code page to utf-8
echo "PYVISTA_OFF_SCREEN=true" >> $env:GITHUB_ENV