name: CI

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

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    runs-on: macos-latest

    strategy:
      matrix:
        node-version: [20, 22, 24]

    steps:
      - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.0

      - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.0.0
        with:
          node-version: ${{ matrix.node-version }}

      - run: npm ci

      - name: Audit production dependencies (fail on high+)
        run: npm audit --audit-level=high --omit=dev

      - name: Verify syntax of entry points
        run: |
          node --check index.js
          node --check safari.js
          node --check mcp-helpers.js
