test: wait for service worker using runningStatus
#29
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
pull_request: | |
branches: | |
- main | |
workflow_call: | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: Test | |
strategy: | |
fail-fast: false | |
matrix: | |
electron-version: | |
- 36 | |
- 37 | |
- 38 | |
node-version: | |
- '22.12.x' | |
os: | |
- macos-latest | |
- ubuntu-latest | |
- windows-latest | |
runs-on: "${{ matrix.os }}" | |
steps: | |
- run: git config --global core.autocrlf input | |
- name: Configure ubuntu | |
if: contains(matrix.os, 'ubuntu') | |
shell: bash | |
run: |- | |
# Setup a virtual display for Electron tests | |
sudo apt install -y xvfb | |
sudo Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
echo "DISPLAY=:99" >> $GITHUB_ENV | |
# Workaround for Electron AppImage apps failing to initialize on Ubuntu due to AppArmor restrictions | |
# Disables unprivileged user namespaces restriction to allow Electron apps to run | |
# Reference: https://github.com/electron/electron/issues/42510 | |
: https://github.com/electron-userland/electron-builder/issues/8440 | |
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
- name: Checkout | |
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
- name: Setup Node.js | |
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
with: | |
node-version: "${{ matrix.node-version }}" | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Electron | |
run: npm install "electron@${{ matrix.electron-version }}" | |
- name: Lint | |
run: npm run lint | |
- name: Build | |
run: npm run build | |
- name: Test | |
run: npm run test |