name: Build and Test
on: [push, pull_request]
jobs:
  build:
    name: Go CI
    runs-on: ubuntu-latest
    strategy:
      matrix:
        go: [1.17, 1.18]
    steps:
      - name: Set up Go
        uses: actions/setup-go@v2
        with:
          go-version: ${{ matrix.go }}
      - name: Check out source
        uses: actions/checkout@v2
      - name: Build
        run: go build ./...
      - name: Test
        run: env GORACE="halt_on_error=1" go test -race ./...
      - name: Lint
        uses: golangci/golangci-lint-action@v2
        with:
          version: v1.45.2

