name: Tests

on:
  push:
    paths:
      - "src/**"
      - "pyproject.toml"
      - "uv.lock"
  workflow_dispatch:

jobs:
  test:
    runs-on: ubuntu-latest
    container: catthehacker/ubuntu:act-latest
    permissions:
      contents: read
      packages: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

      - name: Setup Node.js
        uses: actions/setup-node@v5
        with:
          node-version: "22"

      - name: Install uv
        uses: https://github.com/astral-sh/setup-uv@v6

      - name: Run tests
        run: uv run --env-file=.env.example pytest
