on:
  push:
    branches:
      - master
    paths:
      - "**.go"
      - "go.mod"
  pull_request:
    branches:
      - "**"
    paths:
      - "**.go"
      - "go.mod"
  workflow_dispatch:

name: tests
jobs:
  tests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-go@v5
        with:
          go-version-file: 'go.mod'
          cache-dependency-path: '**/go.sum'
      - run: go test -v -race ./...
      - name: golangci-lint
        uses: golangci/golangci-lint-action@v4
        with:
          args: --timeout=5m
