name: test

on:
  pull_request:
  push:
    branches: [master]

permissions:
  contents: read

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: 24
          cache: npm

      - run: npm ci

      # Workspace packages (e.g. @logicsrc/plugin-core, @logicsrc/validators)
      # publish from dist/, so dependents can't resolve them until built.
      - run: npm run build

      - run: npm test
        env:
          CI: true
