name: Pull Request

on:
  workflow_dispatch: {}
  pull_request:
    branches:
      - main

permissions:
  contents: read

jobs:
  # lint:
  #   name: Lint
  #   runs-on: ubuntu-latest
  #   steps:
  #     - uses: actions/checkout@v4
  #     - uses: actions/setup-go@v5
  #       with:
  #         go-version: stable
  #     - name: golangci-lint
  #       uses: golangci/golangci-lint-action@v6
  #       with:
  #         version: v1.60
  test:
    name: Test
    strategy:
      fail-fast: false
      matrix:
        go-version:
          - 1.24.x
        platform:
          - macos-latest
          - windows-latest
          - ubuntu-latest
    runs-on: ${{ matrix.platform }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: 1.24.x
      - name: Run tests
        run: |
          go test -v -coverprofile coverage.out -covermode atomic ./...
      - name: Publish coverage
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Set up Go
        uses: actions/setup-go@v5
        with:
          go-version: 1.24.x
      - name: Build
        uses: goreleaser/goreleaser-action@90a3faa9d0182683851fbfa97ca1a2cb983bfca3 # v6
        with:
          version: v0.155.0
          args: --snapshot --skip-publish --debug
