File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,13 +73,34 @@ runs:
7373 - name : Execute Commands (macOS)
7474 if : runner.os == 'macOS'
7575 run : |
76+ set -euo pipefail
7677 export DISPLAY=:99
78+ export LIBGL_ALWAYS_SOFTWARE=1
7779 export LIBGL_ALWAYS_INDIRECT=1
7880 # Start a headless X server for OpenGL contexts on CI.
7981 /opt/X11/bin/Xvfb "$DISPLAY" -screen 0 2560x1440x24 +extension GLX +extension RENDER +iglx -ac &
8082 XVFB_PID=$!
8183 trap 'kill "$XVFB_PID" >/dev/null 2>&1 || true' EXIT
82- sleep 3
84+
85+ # Wait for Xvfb to accept connections before starting OpenGL clients.
86+ for _ in $(seq 1 30); do
87+ if /opt/X11/bin/xdpyinfo -display "$DISPLAY" >/dev/null 2>&1; then
88+ break
89+ fi
90+ sleep 1
91+ done
92+
93+ if ! /opt/X11/bin/xdpyinfo -display "$DISPLAY" >/dev/null 2>&1; then
94+ echo "Xvfb did not become ready on $DISPLAY"
95+ exit 1
96+ fi
97+
98+ if ! /opt/X11/bin/xdpyinfo -display "$DISPLAY" | grep -q "GLX"; then
99+ echo "GLX extension is not available on $DISPLAY"
100+ /opt/X11/bin/xdpyinfo -display "$DISPLAY" || true
101+ exit 1
102+ fi
103+
83104 echo "set -e" > /tmp/commands.sh
84105 echo "${{ inputs.commands }}" >> /tmp/commands.sh
85106 chmod +x /tmp/commands.sh
You can’t perform that action at this time.
0 commit comments