name: Node.js CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Install system dependencies
        run: |
          sudo apt-get update \
          && sudo apt-get install -y \
            build-essential clang libdbus-1-dev libgtk-3-dev \
            libnotify-dev libasound2-dev libcap-dev \
            libcups2-dev libxtst-dev \
            libxss1 libnss3-dev gcc-multilib g++-multilib curl \
            gperf bison python3-dbusmock openjdk-8-jre xvfb xvfb-maybe

      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 18.x
          cache: npm
      - run: npm install
      - run: npm run start-local
      - run: npm run test-ci -- --silent=false
        env:
          CI: true
