This repository was archived by the owner on Aug 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
68 lines (60 loc) · 2.18 KB
/
Copy pathci.yml
File metadata and controls
68 lines (60 loc) · 2.18 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
name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: pytest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
# The Ralph codebase imports from a sibling RalphLabsAI/recipe checkout
# via ralph_bootstrap.py. Clone it into the parent directory so
# RALPH_RECIPE_DIR autodetection finds it.
#
# Pin to the CANONICAL recipe tag (the one the validator runs), NOT recipe
# main: main tracks the latest king's auto-merged recipe, which can carry a
# model that breaks the protocol tests (e.g. a U-Net skip-gate forward that
# index-errors on the tests' small config). Bump this when the canonical
# recipe advances.
- name: Checkout RalphLabsAI/recipe
uses: actions/checkout@v4
with:
repository: RalphLabsAI/recipe
ref: recipe-v0.2.3
path: recipe_repo
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# CPU-only torch is enough for the test suite (smoke models on CPU).
pip install --index-url https://download.pytorch.org/whl/cpu torch
pip install pytest cryptography pynacl pyyaml requests numpy tiktoken huggingface-hub
# bittensor is large + pulls async-substrate; only install when
# tests need it (currently audit_scheduler + chain_layer tests).
pip install bittensor || echo "bittensor install failed, marking those tests as expected-skip"
- name: Run tests
env:
RALPH_RECIPE_DIR: ${{ github.workspace }}/recipe_repo
run: |
pytest tests/ -v --tb=short
lint:
name: ruff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install ruff
- run: ruff check . --output-format=github