name: Lint

on:
  push:
    branches: ["main"]
  pull_request:
    branches: ["main"]

permissions:
  contents: read

jobs:
  lint:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: "3.12"
          cache: 'pip'

      - name: Install linters
        run: pip install ruff mypy types-PyYAML

      - name: Run ruff
        run: ruff check .

      - name: Run mypy
        run: mypy src/rekall
