name: ci

permissions:
  contents: read

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  test:
    strategy:
      matrix:
        go-version: [1.23.x,1.24.x,1.25.x]
        os: [ubuntu-latest, macos-latest, windows-latest, ubuntu-24.04-arm]
    runs-on: ${{ matrix.os }}
    steps:
      - name: Install Go
        uses: actions/setup-go@331ce1d993939866bb63c32c6cbbfd48fa76fc57 # v2.1.4
        with:
          go-version: ${{ matrix.go-version }}
      - name: Checkout code
        uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
        with:
          persist-credentials: false
      - name: Test
        run: go test -v ./...

  gen:
    runs-on: ubuntu-latest
    steps:
      - name: Install Go
        uses: actions/setup-go@331ce1d993939866bb63c32c6cbbfd48fa76fc57 # v2.1.4
        with:
          go-version: 1.25.x
      - name: Checkout code
        uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
        with:
          persist-credentials: false
      - name: vet
        run: go vet ./...
      - name: fmt
        run: gofmt -w .
      - name: generate
        working-directory: avo
        run: go generate -v -x
      - name: Git Status
        run: |
          git diff
          test -z "$(git status --porcelain)"
