name: collector-tests

on:
  push:
    branches:
      - main
      - "wt/**"

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

jobs:
  collector-tests:
    name: collector-tests
    runs-on: arc-k3s
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
      - uses: oven-sh/setup-bun@v2
        with:
          bun-version: 1.3.14
      - uses: actions/setup-node@v4
        with:
          node-version: 24.18.0
      - uses: pnpm/action-setup@v4
        with:
          version: 11.5.2
      - name: Install collector dependencies
        env:
          # Keep the lockfile's published URL identity while routing its Tailscale
          # address through the credential-free in-cluster registry gateway.
          HTTP_PROXY: http://platform-registry-gateway.arc-ci.svc.cluster.local:4873
        run: pnpm install --frozen-lockfile --filter overdeck-collector...
      - name: Test collector
        working-directory: collector
        run: bun test
