Skip to content

Commit 5a66d73

Browse files
authored
Merge pull request #1125 from jonathanfischer97/testdocs
Attempt to fix possible multiple PR docs build error
2 parents 1fb5e45 + 3bc96c1 commit 5a66d73

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

.github/workflows/Documentation.yml

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ permissions:
1212
contents: read
1313

1414
concurrency:
15-
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16-
cancel-in-progress: true
15+
group: docs-${{ github.ref }} # Group name for concurrency control
16+
cancel-in-progress: true # Ensures only one doc build runs at a time for each branch/ref, regardless of the trigger
1717

1818
jobs:
1919
build:
@@ -22,11 +22,21 @@ jobs:
2222
- name: Checkout
2323
uses: actions/checkout@v4
2424

25-
# Install binary dependencies needed for GLMakie to run in a headless environment
26-
# xvfb: Creates a virtual frame buffer to simulate a display
27-
# libgl1, mesa-utils, freeglut3-dev, xorg-dev, libxrandr-dev, libxinerama-dev, libxcursor-dev, libxi-dev, libxext-dev: Required libraries for OpenGL rendering
25+
# Install all required X11 and OpenGL libraries
26+
# These are needed for GLMakie to work in a headless environment
2827
- name: Install binary dependencies
29-
run: sudo apt-get update && sudo apt-get install -y xvfb libgl1 mesa-utils freeglut3-dev xorg-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y xvfb libgl1 mesa-utils freeglut3-dev xorg-dev \
31+
libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
32+
33+
# # Start Xvfb explicitly instead of using xvfb-run
34+
# # This gives us more control and visibility into the virtual display setup
35+
# - name: Setup virtual framebuffer
36+
# run: |
37+
# # Start Xvfb and wait for it to be ready
38+
# /usr/bin/Xvfb :99 -screen 0 1024x768x24
39+
# echo "DISPLAY=:99" >> $GITHUB_ENV
3040

3141
- name: Install Julia
3242
uses: julia-actions/setup-julia@latest
@@ -38,22 +48,22 @@ jobs:
3848
with:
3949
cache-name: docs-cache
4050

41-
# Install Julia package dependencies for the documentation project
51+
# Install dependencies with the virtual display already running
4252
- name: Install dependencies
43-
run: >
44-
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ -e 'ENV["JULIA_PKG_SERVER"] = ""; using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
53+
run: |
54+
julia --project=docs/ -e '
55+
ENV["JULIA_PKG_SERVER"] = "";
56+
using Pkg;
57+
Pkg.develop(PackageSpec(path=pwd()));
58+
Pkg.instantiate()'
4559
46-
# Build and deploy the documentation using xvfb to simulate a display for GLMakie
47-
# xvfb-run: Runs Julia with a virtual display to support OpenGL rendering
48-
# --server-args: Configures the virtual display resolution and color depth
60+
# Build documentation with the stable virtual display
4961
- name: Build and deploy
5062
env:
51-
GKSwstype: "100" # Specifies the workstation type for GR framework rendering, https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988/7
52-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Required for permissions to deploy documentation
53-
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
54-
run: >
55-
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24'
56-
julia --project=docs --color=yes --code-coverage=user docs/make.jl
63+
GKSwstype: "100"
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
66+
run: xvfb-run julia --project=docs --color=yes --code-coverage=user docs/make.jl
5767

5868
- name: Upload site as artifact
5969
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)