# CI — syntax check, server tests (node:test), client tests (Vitest), Vite build.
# Runs on every push and pull request so no change lands unverified.
#
# Forgejo Actions reads .forgejo/workflows/. The container image matches the
# Dockerfile runtime (node:22) so better-sqlite3 prebuilds resolve identically.

name: CI

on:
  push:
  pull_request:

jobs:
  ci:
    runs-on: docker
    container:
      image: node:22-bookworm
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install dependencies
        run: npm ci

      - name: Syntax check (server)
        run: npm run check:server

      - name: Server tests (node:test)
        run: npm run test

      - name: Client tests (Vitest)
        run: npm run test:client

      - name: Build (Vite)
        run: npm run build
