Merge pull request #79 from MicroClub-USTHB/feat/automatic-event-life… #232
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: CI | |
| on: | |
| push: | |
| branches: ["main", "develop"] | |
| pull_request: | |
| branches: ["main", "develop"] | |
| jobs: | |
| lint-and-typecheck: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install dependencies | |
| run: uv sync --locked --all-extras --dev | |
| - name: Lint | |
| run: uv run ruff check . | |
| - name: Type Check | |
| run: uv run mypy . | |
| - name: Test Docker Build | |
| run: docker build -t multai-back-test . | |
| test: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: lint-and-typecheck | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: test_db | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_HOST: localhost | |
| REDIS_HOST: localhost | |
| REDIS_PORT: 6379 | |
| NATS_PORT: 4222 | |
| NATS_HOST: localhost | |
| NATS_PASSWORD: dummy | |
| NATS_USER: dummy | |
| MINIO_API_PORT: 9000 | |
| MINIO_ROOT_USER: dummy | |
| MINIO_ROOT_PASSWORD: dummy | |
| MINIO_HOST: localhost | |
| jwt_secret: test_secret | |
| encryption_key: MPCSXH0IYfkp8JTpUNH0vUVyDlUeP6OKI8kz5iK54mw= | |
| FACE_ENCRYPTION_KEY: test_face_encryption_key | |
| FIREBASE_CREDENTIALS_PATH: dummy.json | |
| services: | |
| postgres: | |
| image: pgvector/pgvector:pg16 | |
| env: | |
| POSTGRES_USER: test | |
| POSTGRES_PASSWORD: test | |
| POSTGRES_DB: test_db | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| redis: | |
| image: redis:7-alpine | |
| options: >- | |
| --health-cmd "redis-cli ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 6379:6379 | |
| nats: | |
| image: nats:2.10-alpine | |
| command: --user dummy --pass dummy | |
| ports: | |
| - 4222:4222 | |
| minio: | |
| image: minio/minio:latest | |
| env: | |
| MINIO_ROOT_USER: dummy | |
| MINIO_ROOT_PASSWORD: dummy | |
| command: server /data | |
| ports: | |
| - 9000:9000 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install dependencies | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run Migrations | |
| run: uv run alembic upgrade head | |
| - name: Run Tests | |
| run: uv run pytest tests/ |