name: WebComponent Unit Tests
on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  unit-test:
    name: WebComponent Unit Tests
    runs-on: ov-actions-runner
    steps:
      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '22.13'
      - name: Checkout OpenVidu Meet
        uses: actions/checkout@v4
      - name: Setup OpenVidu Meet WebComponent
        shell: bash
        run: ./prepare.sh --typings --webcomponent
      - name: Run tests
        run: |
          cd frontend/webcomponent
          npm run test:unit
      - name: Clean up
        if: always()
        uses: OpenVidu/actions/cleanup@main
