when:
  - event: pull_request

steps:
  - name: vector-test
    image: artifactapi.k8s.syd1.au.unkin.net/dockerhub/timberio/vector:0.57.0-debian
    commands:
      # Dummy creds + writable dirs so the full topologies build; the unit tests
      # only exercise the transforms (sources are not started).
      - export CLICKHOUSE_USER=ci CLICKHOUSE_PASSWORD=ci
      - export NATS_PRODUCER_PASSWORD=ci NATS_CONSUMER_PASSWORD=ci
      - mkdir -p /vector-data-dir /etc/vault-ca
      - cp /etc/ssl/certs/ca-certificates.crt /etc/vault-ca/ca.crt
      # Transform tier + VM ingest: unit-tested transforms.
      - vector test apps/base/logging/vector/aggregator.yaml apps/base/logging/vector/aggregator-tests.yaml
      - vector test apps/base/logging/vector/vm-ingest.yaml apps/base/logging/vector/vm-ingest-tests.yaml
      # Agent has no transforms to unit-test; validate it builds. (The archiver
      # leg is now the logarchiver service, not a Vector pipeline.)
      - vector validate --no-environment apps/base/logging/vector/agent.yaml
    backend_options:
      kubernetes:
        serviceAccountName: default
        resources:
          requests:
            memory: 256Mi
            cpu: 250m
          limits:
            memory: 1Gi
            cpu: 1
