name: Vitest Tests

on:
  push:
    branches: [main, master]
  pull_request:
    branches: [main, master]

jobs:
  vitest-testing:
    timeout-minutes: 20
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
        with:
          persist-credentials: false
      - uses: actions/setup-node@v5
        with:
          node-version: lts/*
          package-manager-cache: false
      - uses: pnpm/action-setup@v6
      - name: Install dependencies
        run: pnpm install --frozen-lockfile
      - name: Apply drizzle migrations (SQLite)
        run: pnpm migrate
      - name: Run Vitest suites
        run: pnpm test:unit
