name: Template tests

on:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  tests:
    runs-on: MOMP-AUTODOC

    steps:
      - name: Checkout repository
        uses: https://gitea.com/actions/checkout@v4

      - name: Install dependencies
        run: npm ci --cache ~/.npm --prefer-offline

      - name: Run template tests
        env:
          ELECTRON_ENABLE_LOGGING: "1"
          ELECTRON_DISABLE_SANDBOX: "1"
        run: xvfb-run -a bash tests/run_test.sh