Repository navigation
75 lines (68 loc) · 2.45 KB
/
Copy pathci.yml
File metadata and controls
75 lines (68 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
jobs:
backend:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: "3.14"
cache: pip
cache-dependency-path: backend/pyproject.toml
- run: pip install -e 'backend[dev]'
- run: ruff check backend runner
- run: ruff format --check backend runner
- run: pytest -q backend
- name: OpenAPI document is up to date
run: python -m localcode.tools.openapi web/openapi.json && git diff --exit-code web/openapi.json
web:
runs-on: ubuntu-24.04
defaults:
run:
working-directory: web
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "26"
cache: npm
cache-dependency-path: web/package-lock.json
- run: npm ci
- run: npm run lint
- run: npm run format:check
- name: Generated API types are up to date
run: npm run api-types && git diff --exit-code src/generated
- run: npm run typecheck
- run: npm test
- run: npm run build
runner:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: docker build --target test -t localcode-runner-test runner
- run: docker run --rm --init --sysctl kernel.shmmax=16777216 --sysctl kernel.shmall=4096 localcode-runner-test
images:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: docker compose build app
# Every repo-kept problem parses and its solutions pass its tests in the real sandbox.
content:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- run: docker compose up -d --build
- name: Wait for the runner
run: |
for _ in $(seq 60); do
docker compose exec -T -u localcode app python -c "from localcode.judging import runner_client as r; raise SystemExit(0 if r.versions() else 1)" && exit 0
sleep 2
done
docker compose logs; exit 1
- run: make validate-content