name: Go

on:
  push:
    branches:
      - 'main'

jobs:
  benchmark:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2

    - name: Setup Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.18.x

    - name: Run benchmarks
      run: |
        go install golang.org/x/perf/cmd/benchstat@latest
        make benchcmp count=1
