Realese v0.3.0 #2
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: | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| frontend: | |
| name: Frontend lint and build | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint frontend | |
| run: npm run lint | |
| - name: Build frontend | |
| run: npm run build | |
| backend: | |
| name: Backend sanity checks | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: backend | |
| env: | |
| BOT_TOKEN: "123456:TEST_TOKEN_FOR_CI" | |
| DATABASE_URL: "postgresql+asyncpg://user:pass@localhost:5432/santagym" | |
| REDIS_URL: "redis://localhost:6379/0" | |
| JWT_SECRET: "ci-jwt-secret" | |
| WEBHOOK_URL: "https://api.example.com" | |
| FRONTEND_URL: "https://example.com" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Poetry | |
| uses: abatilo/actions-poetry@v4 | |
| with: | |
| poetry-version: "1.8.3" | |
| - name: Configure Poetry | |
| run: poetry config virtualenvs.create false | |
| - name: Install backend dependencies | |
| run: poetry install --no-interaction --no-ansi --no-root | |
| - name: Compile backend sources | |
| run: python -m compileall app | |
| - name: Import API app | |
| run: python -c "from app.main_api import app; print(app.title)" | |
| - name: Render Alembic migration SQL | |
| run: alembic upgrade head --sql > /tmp/alembic.sql | |
| docker: | |
| name: Docker build validation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Validate docker compose config | |
| run: docker compose config | |
| - name: Build backend image | |
| run: docker build -f backend/Dockerfile backend | |
| - name: Build frontend image | |
| run: docker build -f frontend/Dockerfile frontend |