Skip to content

Commit 162a68b

Browse files
authored
Merge pull request #21 from i-walk-away/content
content
2 parents e6a93a6 + 423bca9 commit 162a68b

File tree

2 files changed

+106
-13
lines changed

2 files changed

+106
-13
lines changed
Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: ci
22

33
on:
4-
push:
5-
branches:
6-
- main
74
pull_request:
85
branches:
96
- main
@@ -13,7 +10,6 @@ permissions:
1310

1411
jobs:
1512
approval:
16-
if: github.event_name == 'pull_request'
1713
runs-on: ubuntu-latest
1814
environment:
1915
name: ci
@@ -25,9 +21,6 @@ jobs:
2521
runs-on: ubuntu-latest
2622
needs:
2723
- approval
28-
if: |
29-
always() &&
30-
(github.event_name != 'pull_request' || needs.approval.result == 'success')
3124
steps:
3225
- name: Checkout
3326
uses: actions/checkout@v4
@@ -42,9 +35,6 @@ jobs:
4235
runs-on: ubuntu-latest
4336
needs:
4437
- approval
45-
if: |
46-
always() &&
47-
(github.event_name != 'pull_request' || needs.approval.result == 'success')
4838
env:
4939
UV_PYTHON: 3.12
5040
DB_HOST: localhost
@@ -106,9 +96,6 @@ jobs:
10696
runs-on: ubuntu-latest
10797
needs:
10898
- approval
109-
if: |
110-
always() &&
111-
(github.event_name != 'pull_request' || needs.approval.result == 'success')
11299
steps:
113100
- name: Checkout
114101
uses: actions/checkout@v4

.github/workflows/ci-push.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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

Comments
 (0)