Skip to content

Commit f4bf9a8

Browse files
rathbomaclaude
andcommitted
Add Xvfb for headless Electron on ARM64 Linux
Install xvfb and dbus-x11 for running Electron in headless mode. Start Xvfb before running Electron tests to provide a virtual display. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent 7842ca0 commit f4bf9a8

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/electron-arm64.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ jobs:
2525
apt-get update -q -y
2626
apt-get install -q -y ca-certificates curl gnupg build-essential python3 git \
2727
libgtk-3-dev libnotify-dev libnss3 libxss1 \
28-
libx11-xcb1 libxcb-dri3-0 libdrm2 libgbm1
28+
libx11-xcb1 libxcb-dri3-0 libdrm2 libgbm1 \
29+
xvfb dbus-x11
2930
# Try to install libasound2t64, fallback to libasound2
3031
apt-get install -q -y libasound2t64 || apt-get install -q -y libasound2
3132
# Install Node.js 20 (for Electron build)
@@ -52,6 +53,11 @@ jobs:
5253
echo "Rebuilding for Electron..."
5354
npx @electron/rebuild --version 39.2.7
5455
56+
echo "Starting virtual display for Electron..."
57+
export DISPLAY=:99
58+
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
59+
sleep 2
60+
5561
echo "Running tests with Electron..."
5662
npx electron-mocha --no-sandbox test/**/*.test.js --timeout 10000
5763
@@ -66,5 +72,5 @@ jobs:
6672
fi
6773
6874
echo "Testing Electron module loading..."
69-
npx electron --no-sandbox --version || echo "Electron version check"
70-
npx electron --no-sandbox test/electron-load-test.js || echo "Module loading test completed"
75+
npx electron --no-sandbox --version
76+
npx electron --no-sandbox test/electron-load-test.js

0 commit comments

Comments
 (0)