name: test

on: [push, pull_request]

jobs:
  mod:
    runs-on: ubuntu-latest
    name: Check modules
    steps:
    - uses: actions/setup-go@v6
      with:
        go-version: 'oldstable'
    - uses: actions/checkout@v5
    - 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@v6
      with:
        go-version: ${{ matrix.version }}
    - uses: actions/checkout@v5
    - 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"
