name: CI

on:
  pull_request:
  push:
    branches-ignore:
      - main
    tags-ignore:
      - "v*"

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version-file: go.mod

      - name: Setup Helm
        uses: azure/setup-helm@v4

      - name: Build
        run: go build ./...

      - name: Test
        run: go test ./...

      - name: Helm lint
        run: helm lint chart/agentikube/

      - name: Helm template
        run: |
          helm template agentikube chart/agentikube/ \
            --namespace sandboxes \
            --set storage.filesystemId=fs-test \
            --set sandbox.image=test:latest \
            --set compute.clusterName=test-cluster
