name: Node.js CI

on: [push]

env:
  DATABASE_URL: "postgresql://user:pass@localhost:5432/dummy"
  SKIP_DB_CHECK: 1

jobs:
  build:
    if: github.repository == 'umami-software/umami'
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
        with:
          version: 10
          run_install: false
      - name: Use Node.js 22
        uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: "pnpm"
      - run: npm install --global pnpm
      - run: pnpm install
      - run: pnpm test
      - run: pnpm build
