-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (98 loc) · 3.01 KB
/
ci-train.yml
File metadata and controls
110 lines (98 loc) · 3.01 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: CI Train
on:
push:
branches:
- main
- master
paths:
- "train.py"
- "train_improved.py"
- "src/training/**"
- "src/engine/**"
- "src/model/**"
- "src/game/**"
- "src/data/**"
- "scripts/**"
- "tests/test_mcts_numerics.py"
- "tests/test_training_*.py"
- "pyproject.toml"
- "uv.lock"
- "pyrefly.toml"
- ".github/workflows/ci-train.yml"
pull_request:
paths:
- "train.py"
- "train_improved.py"
- "src/training/**"
- "src/engine/**"
- "src/model/**"
- "src/game/**"
- "src/data/**"
- "scripts/**"
- "tests/test_mcts_numerics.py"
- "tests/test_training_*.py"
- "pyproject.toml"
- "uv.lock"
- "pyrefly.toml"
- ".github/workflows/ci-train.yml"
workflow_dispatch:
concurrency:
group: ci-train-${{ github.ref }}
cancel-in-progress: true
jobs:
train-quality:
runs-on: ubuntu-latest
timeout-minutes: 35
env:
PYTHONUNBUFFERED: "1"
UV_PYTHON: "3.11"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
- name: Sync dependencies (all groups for full-project pyrefly)
run: uv sync --frozen --all-groups
- name: Compatibility shim for pyrefly interpreter path
run: |
mkdir -p .venv/Scripts
ln -sf ../bin/python .venv/Scripts/python.exe
- name: Python file length policy
run: |
uv run python scripts/check_python_max_lines.py \
--max-lines 500 \
--path train.py \
--path src/training \
--path src/engine \
--path src/model \
--path src/game \
--path src/data \
--path tests/test_mcts_numerics.py \
--path tests/test_training_bootstrap.py \
--path tests/test_training_checkpointing.py \
--path tests/test_training_curriculum.py \
--path tests/test_training_monitor.py \
--path tests/test_training_step_numerics.py \
--path scripts/export_model_onnx.py \
--path scripts/check_onnx_parity.py
- name: Ruff (train scope)
run: uv run ruff check train.py src/engine src/model src/game src/data tests scripts
- name: Pyrefly (train scope)
run: uv run pyrefly check train.py src tests
- name: Pytest (train scope)
run: |
uv run pytest -q \
tests/test_mcts_numerics.py \
tests/test_training_bootstrap.py \
tests/test_training_checkpointing.py \
tests/test_training_curriculum.py \
tests/test_training_monitor.py \
tests/test_training_selfplay_runtime.py \
tests/test_training_step_numerics.py \
tests/test_training_trainer_runtime.py