Skip to content

Commit 82077e3

Browse files
committed
ci: install the electron binary on every OS for e2e
The macOS e2e leg failed with "Electron failed to install correctly": the electron postinstall (extract-zip) drops the binary on the macOS runner too, not just Linux, so guarding the install step to ubuntu left macOS without a binary. Run install.js on every OS and keep the unzip repair as a Linux-only fallback. Note: AI-assisted (Claude Code). Manually verified: the workflow yaml parses; this mirrors the binary-install approach that the Linux leg already relied on, extended to macOS where the same postinstall gap appears in CI.
1 parent aa80c0d commit 82077e3

1 file changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,25 @@ jobs:
3737
node-version: '24.x'
3838
cache: 'yarn'
3939
- run: yarn install --frozen-lockfile
40-
# electron's postinstall (extract-zip) leaves dist without the `electron`
41-
# binary on this runner even though the downloaded zip is complete and
42-
# valid, so launch fails with "Electron failed to install correctly". Let
43-
# install.js fetch the zip into the cache, then extract it with the system
44-
# `unzip` and point path.txt at the binary. Linux-only: the zip is the
45-
# linux-x64 build and the binary lives at dist/electron. On macOS the
46-
# postinstall extracts dist/Electron.app correctly and needs no workaround.
40+
# The electron postinstall (extract-zip) intermittently leaves dist without
41+
# the binary on CI runners (it happens on macOS too, not just Linux), so
42+
# launch fails with "Electron failed to install correctly". Run install.js
43+
# explicitly on every OS to fetch and extract the binary.
4744
- name: Install the Electron binary
45+
run: node node_modules/electron/install.js
46+
# On Linux, if extract-zip still dropped the binary, fall back to system
47+
# unzip (the zip is the linux-x64 build, binary at dist/electron).
48+
- name: Repair the Electron binary on Linux if needed
4849
if: matrix.os == 'ubuntu-latest'
4950
run: |
5051
set -euo pipefail
51-
node node_modules/electron/install.js || true
52-
zip=$(ls ~/.cache/electron/*/electron-*-linux-x64.zip | head -1)
53-
rm -rf node_modules/electron/dist
54-
mkdir -p node_modules/electron/dist
55-
unzip -q -o "$zip" -d node_modules/electron/dist
56-
printf 'electron' > node_modules/electron/path.txt
52+
if [ ! -x node_modules/electron/dist/electron ]; then
53+
zip=$(ls ~/.cache/electron/*/electron-*-linux-x64.zip | head -1)
54+
rm -rf node_modules/electron/dist
55+
mkdir -p node_modules/electron/dist
56+
unzip -q -o "$zip" -d node_modules/electron/dist
57+
printf 'electron' > node_modules/electron/path.txt
58+
fi
5759
test -x node_modules/electron/dist/electron
5860
- run: yarn build
5961
# Electron needs system libraries; xvfb provides a display on the headless

0 commit comments

Comments
 (0)