name: Dev Build

on:
  pull_request:
    branches: [dev]
  push:
    branches: [dev]

jobs:
  build-test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '9.0.x'

      - name: Restore backend
        run: dotnet restore
        working-directory: ./backend

      - name: Build backend
        run: dotnet build --no-restore --configuration Release
        working-directory: ./backend

      - name: Test backend
        run: dotnet test --no-build --configuration Release
        working-directory: ./backend

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: "24"

      - name: Install frontend deps
        run: npm ci
        working-directory: ./frontend

      - name: Build frontend
        run: npm run build
        working-directory: ./frontend
