|
| 1 | +name: ci-main |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +jobs: |
| 12 | + lint: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Run ruff check |
| 19 | + uses: astral-sh/ruff-action@v3 |
| 20 | + with: |
| 21 | + src: "./backend" |
| 22 | + args: "check --config pyproject.toml" |
| 23 | + |
| 24 | + backend-tests: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + env: |
| 27 | + UV_PYTHON: 3.12 |
| 28 | + DB_HOST: localhost |
| 29 | + DB_PORT: 3306 |
| 30 | + DB_NAME: pydanticquest_test |
| 31 | + DB_USERNAME: test |
| 32 | + DB_PASSWORD: test |
| 33 | + DB_ROOT_PASSWORD: test |
| 34 | + JWT_SECRET_KEY: test-secret |
| 35 | + JWT_ALGORITHM: HS256 |
| 36 | + JWT_LIFESPAN: 50 |
| 37 | + FRONTEND_URL: http://localhost:5173 |
| 38 | + GITHUB_CLIENT_ID: test |
| 39 | + GITHUB_CLIENT_SECRET: test |
| 40 | + GITHUB_REDIRECT_URI: http://localhost:8000/api/v1/auth/github/callback |
| 41 | + GITHUB_SCOPE: read:user user:email |
| 42 | + GITHUB_ALLOW_SIGNUP: true |
| 43 | + GITHUB_AUTHORIZE_URL: https://github.com/login/oauth/authorize |
| 44 | + GITHUB_TOKEN_URL: https://github.com/login/oauth/access_token |
| 45 | + GITHUB_USER_URL: https://api.github.com/user |
| 46 | + GITHUB_EMAILS_URL: https://api.github.com/user/emails |
| 47 | + PISTON_URL: http://piston:2000 |
| 48 | + PISTON_LANGUAGE: python |
| 49 | + PISTON_VERSION: 3.12.0 |
| 50 | + PISTON_DISABLE_NETWORKING: true |
| 51 | + PISTON_RUN_TIMEOUT_MS: 10000 |
| 52 | + PISTON_COMPILE_TIMEOUT_MS: 10000 |
| 53 | + PISTON_RUN_MEMORY_LIMIT_BYTES: 134217728 |
| 54 | + PISTON_COMPILE_MEMORY_LIMIT_BYTES: 134217728 |
| 55 | + PISTON_OUTPUT_MAX_SIZE: 16000 |
| 56 | + PISTON_MAX_FILE_SIZE: 200000 |
| 57 | + EXECUTION_MAX_OUTPUT_CHARS: 16000 |
| 58 | + EXECUTION_MAX_USER_CODE_CHARS: 20000 |
| 59 | + EXECUTION_MAX_EVAL_SCRIPT_CHARS: 60000 |
| 60 | + EXECUTION_MAX_SOURCE_CHARS: 80000 |
| 61 | + PISTON_MAX_RETRIES: 2 |
| 62 | + PISTON_RETRY_DELAY_MS: 200 |
| 63 | + PISTON_HEALTH_TTL_SEC: 30 |
| 64 | + PISTON_HTTP_TIMEOUT_MS: 5000 |
| 65 | + EXECUTION_RATE_LIMIT_WINDOW_SEC: 60 |
| 66 | + EXECUTION_RATE_LIMIT_MAX: 20 |
| 67 | + steps: |
| 68 | + - name: Checkout |
| 69 | + uses: actions/checkout@v4 |
| 70 | + |
| 71 | + - name: Setup uv |
| 72 | + uses: astral-sh/setup-uv@v5 |
| 73 | + |
| 74 | + - name: Install Python |
| 75 | + run: uv python install 3.12 |
| 76 | + |
| 77 | + - name: Sync dependencies |
| 78 | + run: uv sync --extra test |
| 79 | + |
| 80 | + - name: Run tests |
| 81 | + run: uv run pytest |
| 82 | + |
| 83 | + frontend-e2e: |
| 84 | + runs-on: ubuntu-latest |
| 85 | + steps: |
| 86 | + - name: Checkout |
| 87 | + uses: actions/checkout@v4 |
| 88 | + |
| 89 | + - name: Setup Node |
| 90 | + uses: actions/setup-node@v4 |
| 91 | + with: |
| 92 | + node-version: 24 |
| 93 | + cache: npm |
| 94 | + cache-dependency-path: frontend/package-lock.json |
| 95 | + |
| 96 | + - name: Install frontend dependencies |
| 97 | + run: npm ci |
| 98 | + working-directory: frontend |
| 99 | + |
| 100 | + - name: Install Playwright browser |
| 101 | + run: npx playwright install --with-deps chromium |
| 102 | + working-directory: frontend |
| 103 | + |
| 104 | + - name: Run frontend smoke e2e |
| 105 | + run: npm run test:e2e |
| 106 | + working-directory: frontend |
0 commit comments