Spaces:
Running
Running
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| services: | |
| redis: | |
| image: redis:7 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| working-directory: backend | |
| run: pip install -r requirements.txt | |
| - name: Lint with ruff | |
| working-directory: backend | |
| run: ruff check . | |
| - name: Run tests | |
| working-directory: backend | |
| env: | |
| DATABASE_URL: "sqlite+aiosqlite:///./test.db" | |
| REDIS_URL: "redis://localhost:6379/0" | |
| JWT_SECRET: "test_jwt_secret_ci_only" | |
| ENCRYPTION_KEY_FERNET: "ZmDfcTF7_60GrrY167zsiPd67pEvs0aGOv2oasOM1Pg=" | |
| run: python -m pytest tests/ -v | |