fix: Address all code review feedback #807
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run Backend Tests | |
| on: | |
| push: | |
| branches: [ '**' ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| services: | |
| # Start a Redis service container for the job | |
| redis: | |
| image: redis:alpine | |
| # Expose port 6379 on the service container to be mapped to the host | |
| ports: | |
| - 6379/tcp | |
| # Health check for a passwordless Redis service. | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Set up Python 3.14 | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| cache: 'pip' # Cache pip dependencies | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r backend/requirements.txt -r backend/requirements-dev.txt | |
| - name: Run Pytest | |
| env: | |
| # Pass the dynamically assigned Redis host port to the tests. | |
| CACHE_REDIS_PORT: ${{ job.services.redis.ports['6379'] }} | |
| run: | | |
| cd backend | |
| python -m pytest -v |