- Move external URL checks to its own module under `tests/`. This separates them from integration test, addressing long runs and frequent failures that led to ignoring test results. - Move `check-desktop-runtime-errors` to `tests/checks` to keep all test-related checks into one directory. - Replace `ts-node` with `vite` for running `check-desktop-runtime-errors` to maintain a consistent execution environment across checks. - Implement a timeout for each fetch call. - Be nice to external sources, wait 5 seconds before sending another request to an URL under same domain. This solves rate-limiting issues. - Instead of running test on every push/pull request, run them only weekly. - Do not run tests on each commit/PR but only scheduled (weekly) to minimize noise. - Fix URLs are not captured correctly inside backticks or parenthesis.
73 lines
2.2 KiB
YAML
73 lines
2.2 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, ubuntu, windows ]
|
|
fail-fast: false # Allows to see results from other combinations
|
|
runs-on: ${{ matrix.os }}-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Setup node
|
|
uses: ./.github/actions/setup-node
|
|
-
|
|
name: Install dependencies
|
|
run: npm ci
|
|
-
|
|
name: Configure Ubuntu
|
|
if: 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 ImageMagick for screenshots
|
|
sudo apt install -y imagemagick
|
|
|
|
# Install xdotool and xprop (from x11-utils) for window title capturing
|
|
sudo apt install -y xdotool x11-utils
|
|
-
|
|
name: Test
|
|
shell: bash
|
|
run: |-
|
|
export SCREENSHOT=true
|
|
npm run check:desktop
|
|
-
|
|
name: Upload screenshot
|
|
if: always() # Run even if previous step fails
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: screenshot-${{ matrix.os }}
|
|
path: screenshot.png
|