Skip to content

Commit 1f73e30

Browse files
physicsrobclaude
andcommitted
CI: GitHub Actions lint + CPU test workflow
Publication plan phase 2. Two status checks on push/PR: `lint` (make lint: ruff format --check, ruff check, mypy) and `test` (make test-ci: full suite with --device cpu). Both mirror the Modal test image — CPython 3.12, dev + test-onnx groups from the standalone uv.lock — and UV_LOCKED makes every sync assert that lock is current, the same drift check-modal-lock guards. make test-ci refuses to run outside CI: locally a full-suite run belongs on Modal, and inside the umbrella workspace `uv sync` would rewrite the shared venv (exact sync removes opt-in packages like torchwright_doom's onnxruntime-gpu). Validated via `make test ARGS="--device cpu"` on Modal before adding the workflow. Test Suite Status: 1615 passed, 0 failed, 0 skipped (--device cpu). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 3f9a211 commit 1f73e30

2 files changed

Lines changed: 57 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
concurrency:
9+
group: ci-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
env:
13+
# Match the Modal test image (modal_image.py): CPython 3.12, installed
14+
# from the standalone torchwright/uv.lock. UV_LOCKED makes every sync
15+
# assert that lock is current (the same drift check-modal-lock guards).
16+
UV_PYTHON: "3.12"
17+
UV_LOCKED: "1"
18+
19+
jobs:
20+
lint:
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 15
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: astral-sh/setup-uv@v6
26+
with:
27+
enable-cache: true
28+
- name: Sync dev environment
29+
run: uv sync
30+
- name: Lint
31+
run: make lint
32+
33+
test:
34+
runs-on: ubuntu-latest
35+
timeout-minutes: 60
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: astral-sh/setup-uv@v6
39+
with:
40+
enable-cache: true
41+
- name: Test (CPU)
42+
run: make test-ci

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ test: check-modal-lock
6060
test-logs:
6161
@tail -f /tmp/torchwright-test.log
6262

63+
# CI entry point (.github/workflows/ci.yml): full suite on the runner's CPU,
64+
# synced from the standalone lock like the Modal image. Guarded to CI because
65+
# inside the umbrella workspace `uv sync` operates on the shared venv instead
66+
# (dropping opt-in packages like torchwright_doom's onnxruntime-gpu), and a
67+
# full local suite run belongs on Modal anyway (see test-local's guard).
68+
.PHONY: test-ci
69+
test-ci:
70+
@if [ -z "$$CI" ]; then \
71+
echo "Error: test-ci is the CI entry point (runs the full suite locally)." >&2 ; \
72+
echo " Use 'make test' (Modal) or 'make test-local FILE=...' instead." >&2 ; \
73+
exit 2 ; \
74+
fi
75+
uv sync --group test-onnx
76+
uv run --no-sync pytest tests --device cpu
77+
6378
.PHONY: test-local
6479
test-local:
6580
@if [ -z "$(FILE)" ]; then \

0 commit comments

Comments
 (0)