From 633279869bb6a04bcf35a214fe922f59c2d06226 Mon Sep 17 00:00:00 2001 From: Mathis Lacombe <81530082+Mathos34@users.noreply.github.com> Date: Tue, 2 Jun 2026 16:17:57 +0200 Subject: [PATCH 1/2] ci: add lint + unit test workflow 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. --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..15b3d32 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +jobs: + lint-and-test: + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: pip + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ruff pytest + pip install --index-url https://download.pytorch.org/whl/cpu torch numpy matplotlib tqdm + + - name: Ruff (lint) + run: ruff check . + + - name: Pytest (unit tests) + run: pytest -q tests/ From 0d613c29f67cd5a0e4e2f00b6bd0395673c15b0a Mon Sep 17 00:00:00 2001 From: Mathis Lacombe <81530082+Mathos34@users.noreply.github.com> Date: Tue, 2 Jun 2026 16:36:11 +0200 Subject: [PATCH 2/2] ci: split pip install so PyPI-only deps come from PyPI 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. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15b3d32..32831c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,8 @@ jobs: run: | python -m pip install --upgrade pip pip install ruff pytest - pip install --index-url https://download.pytorch.org/whl/cpu torch numpy matplotlib tqdm + pip install torch --index-url https://download.pytorch.org/whl/cpu + pip install numpy matplotlib tqdm - name: Ruff (lint) run: ruff check .