name: Tests

on:
  push:
    branches:
      - main
  pull_request:
    types:
      - edited
      - opened
      - ready_for_review
      - synchronize
    branches:
      - "*"
  merge_group:

permissions:
  contents: read

jobs:
  lint:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          persist-credentials: false
      - uses: ./.github/actions/setup-goversion
      - run: make lint

  test:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          persist-credentials: false
      - uses: ./.github/actions/setup-goversion
      - uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
        with:
          version: "3.13.1"
      - name: Install jsonnet
        run: go install github.com/google/go-jsonnet/cmd/jsonnet@v0.20.0
      - run: make test

  build:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
        with:
          persist-credentials: false
      - uses: ./.github/actions/setup-goversion
      - run: make cross
