name: test

on: [push, pull_request]

jobs:
  mod:
    runs-on: ubuntu-latest
    name: Check modules
    steps:
    - uses: actions/setup-go@v5
      with:
        go-version: 'oldstable'
    - uses: actions/checkout@v4
    - run: go mod tidy && git diff --exit-code go.mod go.sum
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        version: [ 'oldstable', 'stable' ]
    name: Go ${{ matrix.version }}
    steps:
    - uses: actions/setup-go@v5
      with:
        go-version: ${{ matrix.version }}
    - uses: actions/checkout@v4
    - run: go vet ./...
    - run: go run github.com/onsi/ginkgo/v2/ginkgo -r --randomize-all --randomize-suites --race --trace --fail-on-pending --keep-going --label-filter="!network"
