Repository navigation
Merge pull request #180 from BitMind-AI/feat/v26-public-holdout-release #199
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [dev, main] | |
| pull_request: | |
| jobs: | |
| lint: | |
| name: ruff (lint) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - run: pip install ruff==0.15.21 | |
| - run: ruff check src tests | |
| base-install: | |
| name: base install (dataset registry only) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| # The base install must stay lightweight (pyyaml only) and the dataset | |
| # registry importable without the benchmark stack — bitmind-subnet | |
| # depends on this contract. This job fails if anyone adds an eager | |
| # heavy import to the registry path or a heavy dep to base deps. | |
| - run: pip install . pytest | |
| # Checkpoint recovery is CPU-only and must not require the ML extras. | |
| - run: pytest tests/unit/test_checkpoint.py | |
| - run: | | |
| python - <<'EOF' | |
| from gasbench.dataset.config import load_benchmark_datasets_from_yaml | |
| data = load_benchmark_datasets_from_yaml() | |
| assert data.get("image") and data.get("video"), "registry came back empty" | |
| print({k: len(v) for k, v in data.items()}) | |
| import gasbench | |
| try: | |
| gasbench.run_benchmark | |
| raise SystemExit("benchmark stack importable in base install — heavy dep leaked into base") | |
| except ImportError as e: | |
| assert "gasbench[gpu]" in str(e) | |
| import importlib.metadata as im | |
| dists = sorted(d.metadata["Name"].lower() for d in im.distributions()) | |
| heavy = {"torch", "onnxruntime", "onnxruntime-gpu", "transformers", "timm", "modelscope"} | |
| leaked = heavy & set(dists) | |
| assert not leaked, f"heavy deps in base install: {leaked}" | |
| print("base install contract holds:", dists) | |
| EOF | |
| # Recorder recovery shares the existing metrics and parquet paths, without | |
| # loading torch or the inference backends (same lazy-import policy). | |
| - run: pip install numpy pandas pyarrow | |
| - run: pytest tests/unit/test_recorder_checkpoint.py | |
| benchmark-resume: | |
| name: benchmark interruption recovery (CPU) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| # Use the project's versions, with CPU wheels for the inference tests. | |
| - run: | | |
| python - <<'EOF' | |
| import subprocess, sys, tomllib | |
| with open("pyproject.toml", "rb") as f: | |
| requirements = tomllib.load(f)["project"]["optional-dependencies"]["gpu"] | |
| cpu = [r for r in requirements if r.split("==")[0] in {"torch", "torchvision", "torchaudio"}] | |
| subprocess.check_call([sys.executable, "-m", "pip", "install", *cpu, | |
| "--index-url", "https://download.pytorch.org/whl/cpu"]) | |
| EOF | |
| - run: pip install '.[gpu]' pytest | |
| - name: Install audio decoder for the worker integration test | |
| run: sudo apt-get update && sudo apt-get install -y ffmpeg | |
| # Run all offline tests; the slow network smoke checks remain opt-in. | |
| - run: pytest | |
| typecheck: | |
| name: mypy (advisory) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - run: pip install mypy | |
| # Advisory: the codebase is partially typed. Print findings but never | |
| # fail the build (green check) until type coverage improves. Tighten by | |
| # dropping the `|| true` once the baseline is cleaned up. | |
| - run: mypy src/gasbench --ignore-missing-imports || true |