name: Build & Test with Go on: push: branches: [main] paths: - '**.go' - 'go.mod' - 'go.sum' - '.github/workflows/go.yml' - 'testdata/**' pull_request: branches: [main] paths: - '**.go' - 'go.mod' - 'go.sum' - '.github/workflows/go.yml' - 'testdata/**' jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v6 with: go-version-file: go.mod cache: true - name: Download dependencies run: go mod download - name: Run tests run: go test -v -race ./... - name: Build run: go build -o watchdog . lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - name: Set up Go uses: actions/setup-go@v6 with: go-version-file: go.mod cache: true - name: Run golangci-lint uses: golangci/golangci-lint-action@v9 with: version: latest