Skip to content

Commit 3ba5b6e

Browse files
committed
hoping
1 parent 0a118b2 commit 3ba5b6e

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

action.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)