Skip to content

Commit 54ad150

Browse files
rathbomaclaude
andcommitted
Use ELECTRON_RUN_AS_NODE for ARM64 Electron tests
Run Electron as Node.js process using ELECTRON_RUN_AS_NODE=1. This eliminates the need for GPU, Xvfb, display server, and GUI libraries. Much simpler and more reliable for CI environments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent f4bf9a8 commit 54ad150

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

.github/workflows/electron-arm64.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@ jobs:
2323
# Install dependencies in the container
2424
install: |
2525
apt-get update -q -y
26-
apt-get install -q -y ca-certificates curl gnupg build-essential python3 git \
27-
libgtk-3-dev libnotify-dev libnss3 libxss1 \
28-
libx11-xcb1 libxcb-dri3-0 libdrm2 libgbm1 \
29-
xvfb dbus-x11
26+
apt-get install -q -y ca-certificates curl gnupg build-essential python3 git
3027
# Try to install libasound2t64, fallback to libasound2
3128
apt-get install -q -y libasound2t64 || apt-get install -q -y libasound2
3229
# Install Node.js 20 (for Electron build)
@@ -48,18 +45,13 @@ jobs:
4845
npm install
4946
5047
echo "Installing Electron rebuild tools..."
51-
npm install --save-dev @electron/rebuild [email protected] electron-mocha
48+
npm install --save-dev @electron/rebuild [email protected]
5249
5350
echo "Rebuilding for Electron..."
5451
npx @electron/rebuild --version 39.2.7
5552
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-
61-
echo "Running tests with Electron..."
62-
npx electron-mocha --no-sandbox test/**/*.test.js --timeout 10000
53+
echo "Running tests with Electron (as Node)..."
54+
ELECTRON_RUN_AS_NODE=1 npx electron node_modules/.bin/mocha test/**/*.test.js --timeout 10000
6355
6456
echo "Verifying native module..."
6557
if [ -f "build/Release/sqlanywhere.node" ]; then
@@ -72,5 +64,5 @@ jobs:
7264
fi
7365
7466
echo "Testing Electron module loading..."
75-
npx electron --no-sandbox --version
76-
npx electron --no-sandbox test/electron-load-test.js
67+
ELECTRON_RUN_AS_NODE=1 npx electron --version
68+
ELECTRON_RUN_AS_NODE=1 npx electron test/electron-load-test.js

0 commit comments

Comments
 (0)