Skip to content

chore: update dependencies #2843

chore: update dependencies

chore: update dependencies #2843

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: "Run Automated Tests"
on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
code-style-check:
runs-on: ubuntu-slim
timeout-minutes: 15
steps:
- name: "Checkout code"
uses: actions/checkout@v6
- name: "Use Node.js"
uses: actions/setup-node@v6
with:
node-version: lts/*
cache: "npm"
- name: "Install dependencies"
run: |
node --run install-mm:dev
- name: "Run linter tests"
run: |
node --run test:lint
test:
runs-on: ubuntu-24.04
timeout-minutes: 30
strategy:
matrix:
node-version: [22.x, 24.x, 26.x]
steps:
- name: Install electron dependencies and labwc
run: |
sudo apt-get update
sudo apt-get install -y libnss3 libasound2t64 labwc
- name: "Checkout code"
uses: actions/checkout@v6
- name: "Use Node.js ${{ matrix.node-version }}"
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
check-latest: true
cache: "npm"
- name: "Install MagicMirror²"
run: |
node --run install-mm:dev
- name: "Install Playwright browsers"
run: |
npx playwright install --with-deps chromium
- name: "Prepare environment for tests"
run: |
# On Node >= 26.1.0, extract-zip fails to fully extract the electron binary
# (see https://github.com/max-mapper/extract-zip/issues/154). Workaround:
# download and extract electron manually using the system unzip.
# TODO: simplify this once resolved upstream - e.g. via a fix in extract-zip
# (currently unmaintained) or by electron replacing extract-zip with an alternative.
ELECTRON_VERSION=$(node -e "console.log(require('./node_modules/electron/package.json').version)")
rm -rf node_modules/electron/dist
curl -sSL "https://github.com/electron/electron/releases/download/v${ELECTRON_VERSION}/electron-v${ELECTRON_VERSION}-linux-x64.zip" -o /tmp/electron.zip
unzip -q /tmp/electron.zip -d node_modules/electron/dist
echo -n "electron" > node_modules/electron/path.txt
# Start labwc
WLR_BACKENDS=headless WLR_LIBINPUT_NO_DEVICES=1 WLR_RENDERER=pixman labwc &
touch config/custom.css
- name: "Run tests"
run: |
export WAYLAND_DISPLAY=wayland-0
node --run test