name: Static Analysis

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  check:
    runs-on: ubuntu-latest

    steps:
    - name: Check out code
      uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

    - name: Install Go
      uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v5.0.2
      with:
        go-version: '1.25'

    - name: Install staticcheck
      run: go install honnef.co/go/tools/cmd/staticcheck@latest

    - name: Run staticcheck
      run: |
        staticcheck -version
        staticcheck -- ./...

    - name: Run go vet
      run: go vet ./...
