Skip to content

Commit 1b34c61

Browse files
authored
Merge pull request #1086 from jonathanfischer97/testdocs
Fixed doc build error by specifying DISPLAY, other workflow improvements
2 parents bc99b1a + 1203980 commit 1b34c61

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

.github/workflows/Documentation.yml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,68 @@ on:
77
tags: '*'
88
pull_request:
99

10+
permissions:
11+
actions: write # Allows the workflow to delete old caches created by previous runs, ensuring efficient cache management and preventing the cache from growing indefinitely. https://github.com/julia-actions/cache?tab=readme-ov-file#cache-retention
12+
contents: read
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
16+
cancel-in-progress: true
17+
1018
jobs:
1119
build:
1220
runs-on: ubuntu-latest
1321
steps:
14-
- uses: actions/checkout@v4
15-
- uses: julia-actions/setup-julia@latest
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
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
28+
- 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
30+
31+
- name: Install Julia
32+
uses: julia-actions/setup-julia@latest
1633
with:
1734
version: '1'
18-
- name: Install xvfb and OpenGL libraries
19-
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
35+
36+
# Cache to speed up subsequent runs
37+
- uses: julia-actions/cache@v2
38+
with:
39+
cache-name: docs-cache
40+
41+
# Install Julia package dependencies for the documentation project
2042
- name: Install dependencies
21-
run: julia --project=docs/ -e 'ENV["JULIA_PKG_SERVER"] = ""; using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
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()'
45+
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
2249
- name: Build and deploy
2350
env:
24-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
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
2553
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
26-
GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988
27-
run: |
28-
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24' julia --project=docs/ --code-coverage=user docs/make.jl
54+
run: >
55+
DISPLAY=:0 xvfb-run -s '-screen 0 1024x768x24'
56+
julia --project=docs --color=yes --code-coverage=user docs/make.jl
57+
58+
- name: Upload site as artifact
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: docs-artifact
62+
path: ./docs/build
63+
retention-days: 3
64+
compression-level: 9
65+
overwrite: true
66+
2967
- uses: julia-actions/julia-processcoverage@v1
68+
3069
- uses: codecov/codecov-action@v4
3170
with:
3271
file: lcov.info
3372
token: ${{ secrets.CODECOV_TOKEN }}
3473
fail_ci_if_error: false
74+

docs/src/model_simulation/examples/interactive_brusselator_simulation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Let's again use the oscillating Brusselator model, extending the basic simulatio
1111
using Catalyst
1212
using OrdinaryDiffEq
1313
using GLMakie
14-
GLMakie.activate!(inline = true, visible = false) # hide
14+
GLMakie.activate!(inline = true) # hide
1515
1616
# Define the Brusselator model
1717
brusselator = @reaction_network begin
@@ -155,7 +155,7 @@ This plot will now update in real-time as you move the sliders, allowing for int
155155

156156
To gain more insight into the system's behavior, let's enhance our visualization by adding a phase plot, along with some other improvements:
157157

158-
```@example interactive_brusselator
158+
```julia
159159
# Create the main figure
160160
fig = Figure(size = (1200, 800), fontsize = 18);
161161

@@ -231,7 +231,7 @@ colgap!(param_grid, 10)
231231
colgap!(ic_grid, 10)
232232

233233
# Display the figure
234-
#fig
234+
fig
235235
```
236236

237237
This will create a visualization with both time series and phase plots:

0 commit comments

Comments
 (0)