when:
  - event: [pull_request, push]

steps:
  - name: test
    image: golang:1.26
    commands:
      # Fetch the envtest control-plane binaries; the controller tests skip
      # gracefully if this cannot be downloaded.
      - export KUBEBUILDER_ASSETS="$(go run sigs.k8s.io/controller-runtime/tools/setup-envtest@latest use 1.31.0 -p path 2>/dev/null)"
      - go test -race -count=1 -mod=vendor ./...
    backend_options:
      kubernetes:
        serviceAccountName: autobackup-operator-ci
        resources:
          requests:
            memory: 1Gi
            cpu: 1
          limits:
            memory: 2Gi
            cpu: 2
