# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Set up Go
      uses: actions/setup-go@v4
      with:
        # The version the module declares, not whatever is newest. golangci-lint
        # reads type data written by the compiler, and a Go release newer than the
        # pinned linter makes it unreadable, which fails every pull request at once.
        go-version-file: go.mod
    - name: build
      run: go build .

    - uses: actions/setup-python@v3
    - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
    - name: test
      run: go test ./...
