name: CI

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  test:
    name: Build
    strategy:
      matrix:
        go-version: [1.12.x, 1.23.x, 1.24.x]
        platform: [ubuntu-24.04]
    runs-on: ${{ matrix.platform }}
    steps:
      - name: Install Go
        uses: actions/setup-go@v5
        with:
          go-version: ${{ matrix.go-version }}

      - name: Check out code into the Go module directory
        uses: actions/checkout@v4

      - name: Build
        run: make build

      - name: Test
        run: make test

  lint:
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/checkout@v4
      - uses: golangci/golangci-lint-action@v7
        with:
          version: v2.1
