name: UI CI

on:
  pull_request:
    branches:
      - '**'
    paths:
      - 'ui/**'

concurrency:
  group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
  cancel-in-progress: true

jobs:
  test_mantine_ui:
    name: Test mantine-ui
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./ui/mantine-ui
    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
      - uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
        with:
          node-version-file: './ui/mantine-ui/.nvmrc'
          cache: 'npm'
          cache-dependency-path: '**/package-lock.json'
      - name: Install dependencies
        run: npm install
      - name: Run build
        run: npm run build
      - name: Run tests
        run: npm test
