Repository navigation
88 lines (81 loc) · 2.81 KB
/
Copy pathci.yml
File metadata and controls
88 lines (81 loc) · 2.81 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
76
77
78
79
80
81
82
83
84
85
86
87
88
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- run: pip install ruff
- run: ruff check .
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
# CPU torch: the default Linux wheel drags in ~2.5 GB of CUDA libraries
# that neither pyright nor the CPU suite touches.
- run: uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu
- run: uv pip install --system -e ".[dev]"
- run: pyright
# The CPU suite in four parallel shards (a runner has 4 vCPUs; the suite is
# ~330 CPU-seconds locally, a third of it the route tests). The last shard
# takes every directory the others don't name, so a new one is never skipped.
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shard:
- "tests/server"
- "tests/lens tests/units tests/sae tests/cli"
- "tests/fit tests/session tests/model tests/loom"
- "tests --ignore=tests/server --ignore=tests/lens --ignore=tests/units --ignore=tests/sae --ignore=tests/cli --ignore=tests/fit --ignore=tests/session --ignore=tests/model --ignore=tests/loom"
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: "3.13"
- uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
with:
enable-cache: true
cache-dependency-glob: pyproject.toml
- run: uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu
- run: uv pip install --system -e ".[dev]"
- run: pytest -q -m "not gpu" -n auto ${{ matrix.shard }}
webui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: "24"
cache: npm
cache-dependency-path: webui/package-lock.json
- run: npm ci
working-directory: webui
- run: npm run check
working-directory: webui
- run: npm run build
working-directory: webui
- name: Verify committed web bundle is current
run: |
if [ -n "$(git status --porcelain --untracked-files=all -- drowse/web/dist/)" ]; then
git status --short --untracked-files=all -- drowse/web/dist/
exit 1
fi