-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (96 loc) · 3.34 KB
/
deploy.yml
File metadata and controls
113 lines (96 loc) · 3.34 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
name: GitHub Pages Deploy
on:
push:
branches: [main]
workflow_dispatch:
env:
BASE_URL: /${{ github.event.repository.name }}
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
defaults:
run:
shell: bash -leo pipefail {0}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Pages
uses: actions/configure-pages@v5
- name: Set up conda env
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment.yml
cache-environment: true
create-args: >-
libegl
# mesalib
# ipywidgets
# trame
# trame-vtk
# trame-vuetify
- name: Install JB2
run: python -m pip install -U --pre "jupyter-book==2.*" --no-deps -v
# - name: Set up PyVista
# # libglx-mesa0, libgl1, xvfb already present in ubuntu-24.04
# run: |
# sudo apt-get update
# sudo apt-get install -y libglx-mesa0 libgl1 xvfb libosmesa6
# - name: Start xvfb
# run: python -c "import pyvista as pv; pv.start_xvfb()"
- name: PyVista test
run: |
xvfb-run -s "-screen 0 1024x768x24" python -c '
import os
import vtk
import pyvista as pv
# pv.BUILDING_GALLERY = True
print("=== Environment variables ===")
print("VTK_DEFAULT_OPENGL_WINDOW =", os.environ.get("VTK_DEFAULT_OPENGL_WINDOW"))
print("PYVISTA_OFF_SCREEN =", os.environ.get("PYVISTA_OFF_SCREEN"))
print("\n=== VTK backend check ===")
rw = vtk.vtkRenderWindow()
print("RenderWindow backend:", rw.GetClassName())
print("\n=== PyVista backend check ===")
# print("PyVista rendering_backend:", pv.global_theme.rendering_backend)
# Force PyVista to off-screen if not already
# pv.global_theme.off_screen = True
print("PyVista OFF_SCREEN before:", pv.OFF_SCREEN)
pv.OFF_SCREEN = True
print("\n=== Rendering test ===")
sphere = pv.Sphere()
plotter = pv.Plotter(off_screen=True)
plotter.add_mesh(sphere, color="tomato")
plotter.show(screenshot="backend_test.png")
print("Rendered sphere saved as backend_test.png")
'
env:
PYVISTA_OFF_SCREEN: true
# VTK_DEFAULT_OPENGL_WINDOW: vtkOSOpenGLRenderWindow
VTK_DEFAULT_OPENGL_WINDOW: vtkXOpenGLRenderWindow
# JB2 has --execute, but this way we can see how long it takes
- name: Execute the notebook
run: jupyter nbconvert --to notebook --execute --inplace 03-viz.ipynb
env:
PYVISTA_OFF_SCREEN: true
# VTK_DEFAULT_BACKEND: X
# VTK_USE_OSMESA: "1"
# VTK_DEFAULT_OPENGL_WINDOW: vtkOSOpenGLRenderWindow
VTK_DEFAULT_OPENGL_WINDOW: vtkXOpenGLRenderWindow
- name: Build HTML
run: jupyter book build --html --strict --ci
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: "./_build/html"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4