name: Test

concurrency:
  group: test-${{ github.event_name }}-${{ github.ref }}
  cancel-in-progress: true

on:
  push:
    branches:
      - 'main'
  pull_request:

jobs:
  build-test:
    name: Build Test
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          check-latest: true
          go-version-file: 'go.mod'

      - name: Run test
        run: |
          go test ./...
