Feature/45 game service #82
Workflow file for this run
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] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| UV_CACHE_DIR: /tmp/.uv-cache | |
| jobs: | |
| usermanagement-service: | |
| name: Usermanagement Service | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend/usermanagement-service | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install UV | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Restore UV cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: /tmp/.uv-cache | |
| key: uv-${{ runner.os }}-${{ hashFiles('backend/usermanagement-service/pyproject.toml') }} | |
| restore-keys: | | |
| uv-${{ runner.os }}- | |
| - name: Install dependencies | |
| run: uv sync --extra test | |
| - name: Install shared package | |
| run: uv pip install ../shared | |
| - name: Lint with Ruff | |
| run: uv run ruff check . | |
| - name: Check formatting with Ruff | |
| run: uv run ruff format --check . | |
| - name: Run tests with coverage | |
| run: uv run pytest --cov=src --cov-report=xml --cov-report=term-missing | |
| env: | |
| DATABASE_URL: "sqlite+aiosqlite:///:memory:" | |
| - name: Upload coverage report | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: backend/usermanagement-service/coverage.xml | |
| flags: usermanagement | |
| fail_ci_if_error: false | |
| continue-on-error: true | |
| - name: Minimize UV cache | |
| run: uv cache prune --ci | |
| frontend-build: | |
| name: Frontend Build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "latest" | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Lint Code | |
| run: bun run lint | |
| - name: Run Component Tests | |
| run: bun run test | |
| - name: Build frontend | |
| run: bun run build | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: [usermanagement-service, frontend-build] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build usermanagement-service image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: infra/docker/dockerfile-usermanagement | |
| push: false | |
| tags: usermanagement-service:test | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |