Repository navigation
54 lines (44 loc) · 1.72 KB
/
Copy pathcheck-pr-docs-build.yml
File metadata and controls
54 lines (44 loc) · 1.72 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
name: Docs Build (PR)
# The documentation is built and deployed in the nightly-docs.yml workflow.
# This workflow builds the documentation for pull requests to the main branch
# to catch any issues building the documentation before merging.
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docs_build:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Load Visor env
uses: ./.github/actions/load-visor-env
# Install Xvfb and Mesa for headless OpenGL rendering (needed for VTK and similar libraries)
- name: Install Xvfb and Mesa
run: |
sudo apt-get update
sudo apt-get install -y xvfb mesa-utils libgl1
# Start Xvfb on display :99 to provide a virtual X server for graphical tests
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1920x1080x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
# Run tests with DISPLAY=:99 (for Xvfb) and VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN=1
# VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN=1 ensures VTK uses offscreen rendering to avoid X errors
- name: Run Ansys documentation building action
uses: ansys/actions/doc-build@v11.1.3
env:
DISPLAY: ":99" # Use the virtual X server started by Xvfb
VTK_DEFAULT_RENDER_WINDOW_OFFSCREEN: "1" # Force VTK to use offscreen rendering
with:
checkout: false
python-version: ${{ env.MAIN_PYTHON_VERSION }}
check-links: false
sphinxopts: '-j auto'
optional-dependencies-name: ""
group-dependencies-name: "doc"