name: build

on:
  pull_request:

  push:
    branches:
      - main

  workflow_dispatch:

permissions:
  contents: none

jobs:

  compatibility:
    strategy:
      fail-fast: false
      matrix:
        go-version: [oldstable]
        platform: [ubuntu-latest, ubuntu-24.04-arm]

    runs-on: ${{ matrix.platform }}
    steps:
      - name: Checkout
        uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
      - name: Setup Go
        uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
        with:
          go-version: ${{ matrix.go-version }}

      - name: Run Verify
        run: make verify

      - name: Run Cross Build
        run: make cross-build