Skip to content

Elves run #2 — complete FactoMineR feature parity (MFA family, predict, long tail) #137

Elves run #2 — complete FactoMineR feature parity (MFA family, predict, long tail)

Elves run #2 — complete FactoMineR feature parity (MFA family, predict, long tail) #137

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
schedule:
- cron: "17 4 * * 1" # Mondays 04:17 UTC
workflow_dispatch:
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install package + dev deps
run: |
python -m pip install -U pip wheel
python -m pip install -e '.[dev]'
- name: Ruff lint
run: ruff check factominer tests
- name: Mypy
run: mypy factominer || true # advisory until type annotations stabilize
- name: Pytest (R-fixture-driven; no R needed)
run: pytest -q
- name: Sphinx build
run: sphinx-build -b html docs docs/_build/html
rpy2-parity:
# Live cross-check against R FactoMineR. Runs on the weekly schedule
# and is manually triggerable via workflow_dispatch.
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install R (latest release)
uses: r-lib/actions/setup-r@v2
with:
r-version: "release"
use-public-rspm: true
- name: Install FactoMineR + jsonlite from CRAN
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::FactoMineR
any::jsonlite
- name: Report R + FactoMineR versions
run: |
R --version | head -1
Rscript -e 'cat("FactoMineR", as.character(packageVersion("FactoMineR")), "\n"); cat("jsonlite", as.character(packageVersion("jsonlite")), "\n")'
- name: Install package + dev deps
run: |
python -m pip install -U pip wheel
python -m pip install -e '.[dev]'
- name: Regenerate fixtures from live R FactoMineR
run: Rscript tools/refresh_r_fixtures.R
- name: Pytest against freshly-generated R fixtures
run: pytest -q
- name: Show fixture diff vs committed fixtures
if: always()
run: |
git --no-pager diff --stat tests/fixtures/r_outputs/ || true
mkdir -p artifacts
git --no-pager diff tests/fixtures/r_outputs/ > artifacts/r_fixture_drift.diff || true
wc -l artifacts/r_fixture_drift.diff || true
tar -czf artifacts/r_outputs_fresh.tar.gz -C tests/fixtures r_outputs || true
- name: Upload fixture drift diff
if: always()
uses: actions/upload-artifact@v4
with:
name: r-fixture-drift
path: artifacts/r_fixture_drift.diff
if-no-files-found: ignore
- name: Upload regenerated fixtures
if: always()
uses: actions/upload-artifact@v4
with:
name: r-outputs-fresh
path: artifacts/r_outputs_fresh.tar.gz
if-no-files-found: ignore