-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathaction.yml
47 lines (42 loc) · 1.4 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
name: 'setup-headless-display-action'
description: 'Setup a headless display on Linux and Windows'
author: PyVista Developers'
branding:
icon: 'monitor'
color: 'blue'
runs:
using: "composite"
steps:
- name: Install Linux GL Dependencies
if: runner.os == 'Linux'
shell: bash
run: sudo apt-get update && sudo apt-get install libgl1-mesa-glx xvfb -y
- 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 &
- name: Give xvfb some time to start on Linux
if: runner.os == 'Linux'
shell: bash
run: sleep 3
- name: Configure for PyVista on Linux and macOS
if: runner.os != 'Windows'
shell: bash
run: echo "PYVISTA_OFF_SCREEN=true" >> $GITHUB_ENV
- name: Configure for PyVista on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
chcp 65001 #set code page to utf-8
echo "PYVISTA_OFF_SCREEN=true" >> $env:GITHUB_ENV