name: Tests head

permissions: write-all

on:
  schedule:
    - cron: "0 0 * * *"
  workflow_dispatch:
  pull_request:
    types: [opened, labeled, synchronize, reopened]

jobs:
  test:
    if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || github.event_name == 'pull_request'
    runs-on: [self-hosted, style-checker-aarch64]
    strategy:
      matrix:
        go:
          - "1.25"
        clickhouse:
          - "head"
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Install Go ${{ matrix.go }}
        uses: actions/setup-go@v5
        with:
          go-version: ${{ matrix.go }}

      - name: Tests
        env:
          TESTCONTAINERS_RYUK_DISABLED: "true"
          GOTOOLCHAIN: "local"
        run: |
          CLICKHOUSE_VERSION=${{ matrix.clickhouse }} make test
