-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathaction.yml
More file actions
138 lines (128 loc) · 4.35 KB
/
action.yml
File metadata and controls
138 lines (128 loc) · 4.35 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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"
wm:
description: |
Install window manager on Linux. Can currently be "false" or "herbstluftwm".
required: false
default: "false"
mesa3d-release:
description: |
Mesa3D release to install (by default, the latest release is installed).
This is only used on Windows.
required: false
default: "24.3.0"
install-mesa3d-offscreen:
description: |
Installs Mesa3D off-screen renderer on Windows. Configures VTK to use it
by means of the `VTK_DEFAULT_OPENGL_WINDOW` environment variable.
This is only used on Windows.
required: false
default: "true"
branding:
icon: "monitor"
color: "blue"
runs:
using: "composite"
steps:
- name: Update apt
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
- name: Install Linux dependencies
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get install -y \
libglx-mesa0 \
libgl1 \
xvfb \
x11-xserver-utils
- name: Install Linux Window manager
shell: bash
if: runner.os == 'Linux' && inputs.wm == 'herbstluftwm'
run: sudo apt-get install -y herbstluftwm
- name: Install Linux Qt dependencies
if: runner.os == 'Linux' && inputs.qt != 'false'
shell: bash
run: |
sudo apt-get install -y \
libdbus-1-3 \
libegl1 \
libopengl0 \
libosmesa6 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-xfixes0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxkbcommon-x11-0 \
mesa-utils \
x11-utils \
libpulse0
- name: Determine OpenGL version to install on Windows
if: runner.os == 'Windows'
shell: bash
run: |
if [ "${{ inputs.mesa3d-release }}" == "latest" ]; then
if [[ "${{ inputs.install-mesa3d-offscreen }}" == "true" ]]; then
echo "Using latest Mesa3D release with off-screen renderer..."
export MESA3D_VERSION=25.0.7
else
echo "Fetching latest Mesa3D release version..."
export MESA3D_VERSION=$(curl -s https://api.github.com/repos/pal1000/mesa-dist-win/releases/latest | grep -o '"tag_name": ".*"' | sed 's/"tag_name": "\(.*\)"/\1/')
fi
else
echo "Using specified Mesa3D release version..."
export MESA3D_VERSION=${{ inputs.mesa3d-release }}
fi
echo "MESA3D_VERSION=${MESA3D_VERSION}" | tee -a $GITHUB_ENV
- name: Enable Mesa3D off-screen renderer on Windows
if: runner.os == 'Windows' && inputs.install-mesa3d-offscreen == 'true'
shell: bash
run: |
echo "Enabling Mesa3D off-screen renderer for Windows..."
export MESA3D_OFFSCREEN="true"
echo "MESA3D_OFFSCREEN=${MESA3D_OFFSCREEN}" | tee -a $GITHUB_ENV
- name: Install OpenGL on Windows
if: runner.os == 'Windows'
shell: cmd
run: bash ${{ github.action_path }}\windows\install_opengl.sh
- 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: Start window manager on Linux
if: runner.os == 'Linux' && inputs.wm == 'herbstluftwm'
shell: bash
run: |
herbstluftwm &
sleep 3
- name: Configure for PyVista
if: inputs.pyvista != 'false'
shell: bash
run: echo "PYVISTA_OFF_SCREEN=true" >> $GITHUB_ENV
- name: Configure Mesa3D for PyVista/VTK (on Windows)
if: runner.os == 'Windows' && inputs.install-mesa3d-offscreen == 'true'
shell: bash
run: |
echo "VTK_DEFAULT_OPENGL_WINDOW=vtkOSOpenGLRenderWindow" >> $GITHUB_ENV