name: Go Build Matrix
on:
  push:
    branches:
      - main
  pull_request:
permissions:
  contents: read
  pull-requests: read
jobs:
  cross:
    name: Build on ${{ matrix.os }} with Go ${{ matrix.go-version }}
    runs-on: ${{ matrix.os }}
    env:
      CGO_ENABLED: 0
    strategy:
      matrix:
        go-version:
          - oldstable
          - stable
        os:
          - ubuntu-latest
          - macos-14 # M1 runners
          - macos-latest
          - windows-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v5
      - name: Set up Go
        uses: actions/setup-go@v6
        with:
          go-version: ${{ matrix.go-version }}
      - name: Build the module
        run: go build -v ./...
