Skip to content

ci: add lint + unit test workflow#3

Merged
Mathos34 merged 2 commits into
mainfrom
ci/gridworld-world-model-workflow
Jun 2, 2026
Merged

ci: add lint + unit test workflow#3
Mathos34 merged 2 commits into
mainfrom
ci/gridworld-world-model-workflow

Conversation

@Mathos34

@Mathos34 Mathos34 commented Jun 2, 2026

Copy link
Copy Markdown
Owner

Objective

Wire ruff + pytest into GitHub Actions so every push and PR gets a green check (or a red one if something regresses).

Changes

  • New .github/workflows/ci.yml: single job, ubuntu-latest, 15-minute timeout.
    • Python 3.11 with pip cache.
    • Installs ruff, pytest, and the CPU-only torch, numpy, matplotlib, tqdm subset needed by the test path (the full deps from requirements.txt are not required to run the test suite; only train.py needs them).
    • ruff check . then pytest -q tests/.

Validation

  • python -m ruff check . locally: clean.
  • python -m pytest -q tests/ locally: 18 tests pass.
  • YAML inspected by hand for typos. Will be tested live on the PR run.

Risk

low. Pure additive workflow file under .github/workflows/. No source modification. If the workflow has a YAML problem, GitHub will refuse to schedule it; no impact on main.

Out of scope

  • Matrix over multiple Python versions (start with 3.11, add 3.10 and 3.12 later if useful).
  • Coverage upload (separate backlog item if we care about a number).
  • Caching the torch wheel install across runs (the pip cache should already handle it).
  • README CI badge (separate, follow-up PR once this workflow has a passing run on main).

Tracked item: gridworld-world-model CI workflow.

Mathos34 added 2 commits June 2, 2026 16:17
Runs on push to main and on every PR. Installs ruff, pytest, and the
CPU-only torch + numpy + matplotlib + tqdm subset needed by the test
path (no training-time deps). Then runs `ruff check .` and
`pytest -q tests/`.

CPU torch from the pytorch download index keeps install time and disk
under a minute (vs the 800 MB CUDA wheel pip would pick otherwise).
Cache is keyed on pip so subsequent runs reuse the wheels.
The previous version pinned the entire `pip install` to the pytorch
CPU index via `--index-url`, which made pip refuse `matplotlib`
(it does not publish there). Fix: install only `torch` via that
index, then `numpy matplotlib tqdm` via the default PyPI in a second
command.
@Mathos34 Mathos34 merged commit 5543cc7 into main Jun 2, 2026
1 check passed
@Mathos34 Mathos34 deleted the ci/gridworld-world-model-workflow branch June 2, 2026 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant