name: Test with Pytest

on:
  push:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest

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

      - name: Set up Python
        uses: actions/setup-python@v6
        with:
          python-version: '3.14'

      - name: Install Redis
        run: |
          sudo apt-get update
          sudo apt-get install -y redis-server
          sudo service redis-server start
          sudo service redis-server status

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt

      - name: Run Tests
        run: |
          pytest --maxfail=1 --disable-warnings -v
