name: test

on: [push, pull_request]

permissions:
  contents: read

jobs:
  mod:
    runs-on: ubuntu-latest
    name: Check modules
    steps:
    - uses: actions/setup-go@v4
      with:
        go-version: '1.20'
    - uses: actions/checkout@v4
    - run: go mod tidy && git diff --exit-code go.mod go.sum
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: [ '1.20', '1.21' ]
    name: Go ${{ matrix.version }}
    steps:
    - uses: actions/setup-go@v4
      with:
        go-version: ${{ matrix.version }}
    - uses: actions/checkout@v4
    - run: go vet ./...
    - run: go run ./ginkgo -r -randomize-all -randomize-suites -race -trace -procs=2 -poll-progress-after=10s -poll-progress-interval=10s
