GitHub runners now use Ubuntu 24.04, which introduces two issues
affecting Electron application runtime checks:
1. AppArmor restrictions on unprivileged user namespaces
2. Outdated Mesa drivers
This commit resolves both with workarounds.
Changes:
- Disable AppArmor restrictions on unprivileged user namespaces:
- Resolves the following error:
```
[5475:1011/121711.489417:FATAL:setuid_sandbox_host.cc(158)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /tmp/.mount_privacv1kcOj/chrome-sandbox is owned by root and has mode 4755.
```
- Related key Electron issues:
- electron/electron#41066
- electron/electron#42510
- electron-userland/electron-builder#8440
- Update Mesa drivers
- Fixes following errors:
```
MESA: error: ZINK: failed to choose pdev
glx: failed to create drisw screen
```
- Installs latest Mesa drivers from Kisak PPA
89 lines
3.0 KiB
YAML
89 lines
3.0 KiB
YAML
name: checks.desktop-runtime-errors
|
|
# Verifies desktop builds for Electron applications across multiple OS platforms (macOS ,Ubuntu, and Windows).
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
|
|
jobs:
|
|
run-check:
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- macos-latest # Apple silicon (ARM64)
|
|
- macos-13 # Intel-based (x86-64)
|
|
- ubuntu-latest
|
|
- windows-latest
|
|
fail-fast: false # Allows to see results from other combinations
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v4
|
|
-
|
|
name: Setup node
|
|
uses: ./.github/actions/setup-node
|
|
-
|
|
name: Install dependencies
|
|
uses: ./.github/actions/npm-install-dependencies
|
|
-
|
|
name: Install ImageMagick # For screenshots
|
|
uses: ./.github/actions/install-imagemagick
|
|
-
|
|
name: Configure Ubuntu
|
|
if: contains(matrix.os, 'ubuntu')
|
|
shell: bash
|
|
run: |-
|
|
sudo apt update
|
|
|
|
# Configure AppImage dependencies
|
|
sudo apt install -y libfuse2
|
|
|
|
# Configure DBUS (fixes `Failed to connect to the bus: Could not parse server address: Unknown address type`)
|
|
if ! command -v 'dbus-launch' &> /dev/null; then
|
|
echo 'DBUS does not exist, installing...'
|
|
sudo apt install -y dbus-x11 # Gives both dbus and dbus-launch utility
|
|
fi
|
|
sudo systemctl start dbus
|
|
DBUS_LAUNCH_OUTPUT=$(dbus-launch)
|
|
if [ $? -eq 0 ]; then
|
|
echo "${DBUS_LAUNCH_OUTPUT}" >> $GITHUB_ENV
|
|
else
|
|
echo 'Error: dbus-launch command did not execute successfully. Exiting.' >&2
|
|
echo "${DBUS_LAUNCH_OUTPUT}" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Configure fake (virtual) display
|
|
sudo apt install -y xvfb
|
|
sudo Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
|
echo "DISPLAY=:99" >> $GITHUB_ENV
|
|
|
|
# Install xdotool and xprop (from x11-utils) for window title capturing
|
|
sudo apt install -y xdotool x11-utils
|
|
|
|
# Workaround for Electron AppImage apps failing to initialize on Ubuntu 24.04 due to AppArmor restrictions
|
|
# Disables unprivileged user namespaces restriction to allow Electron apps to run
|
|
# Reference: https://github.com/electron/electron/issues/42510
|
|
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
|
|
|
# Workaround for Mesa driver issues on Ubuntu 24.04
|
|
# Installs latest Mesa drivers from Kisak PPA
|
|
# Reference: https://askubuntu.com/q/1516040
|
|
sudo add-apt-repository ppa:kisak/kisak-mesa
|
|
sudo apt update
|
|
sudo apt upgrade
|
|
-
|
|
name: Test
|
|
shell: bash
|
|
run: |-
|
|
export SCREENSHOT=true
|
|
npm run check:desktop
|
|
-
|
|
name: Upload screenshot
|
|
if: always() # Run even if previous step fails
|
|
uses: ./.github/actions/upload-artifact
|
|
with:
|
|
name: screenshot-${{ matrix.os }}
|
|
path: screenshot.png
|