Skip to content

Add CI workflow to test documentation notebooks#615

Open
FBumann wants to merge 7 commits intomasterfrom
feat/test-notebooks
Open

Add CI workflow to test documentation notebooks#615
FBumann wants to merge 7 commits intomasterfrom
feat/test-notebooks

Conversation

@FBumann
Copy link
Collaborator

@FBumann FBumann commented Mar 13, 2026

Summary

  • Adds a new GitHub Actions workflow (test-notebooks.yml) that executes all example notebooks to catch breakage before it reaches the published docs
  • Sets nbsphinx_allow_errors = False so the RTD Sphinx build fails on notebook errors (was True, silently hiding errors)
  • Fixes nbsphinx_execute_never which was never working (not supported in nbsphinx 0.9.4); uses notebook metadata {"nbsphinx": {"execute": "never"}} instead
  • Updates gurobipy pin from ==11.0.2 (expired bundled license) to >=13.0.0
  • Uses reformulate_sos="auto" in piecewise-linear-constraints notebook
  • Adds reader-facing notes to notebooks that are not executed during the docs build, explaining why there are no outputs

Notebooks skipped in CI and RTD

  • solve-on-oetc.ipynb — requires Google Cloud credentials
  • solve-on-remote.ipynb — requires SSH/remote server access

All other notebooks are executed in both CI and RTD.

Closes #560

Test plan

  • All non-skipped notebooks executed successfully locally
  • RTD build passes with nbsphinx_allow_errors = False
  • CI notebook workflow passes

🤖 Generated with Claude Code

FBumann and others added 7 commits March 13, 2026 10:22
Adds a GitHub Actions workflow that executes all example notebooks
to catch breakage before it reaches the published docs. Also sets
nbsphinx_allow_errors to False so Sphinx builds fail on notebook errors.

Closes #560

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Revert nbsphinx_allow_errors back to True for RTD (infeasible-model
  notebook requires gurobi which has an expired license on RTD)
- Uninstall gurobipy in CI workflow to prevent it from being auto-selected
  as default solver (no license available in CI)
- Skip infeasible-model.ipynb in CI (gurobi-specific functionality)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HiGHS does not support SOS constraints, so this notebook needs a
commercial solver like Gurobi or CPLEX.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set nbsphinx_allow_errors to False so real notebook errors are caught
during the RTD build. Notebooks requiring credentials or commercial
solvers are excluded from execution via nbsphinx_execute_never.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update gurobipy pin from ==11.0.2 (expired license) to >=13.0.0
- Use reformulate_sos="auto" in piecewise-linear-constraints notebook
  so it works with HiGHS (no SOS support needed)
- Remove gurobipy uninstall workaround from CI workflow
- Un-skip infeasible-model and piecewise-linear-constraints notebooks
  since they now work with a valid license / open-source solver

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Update gurobipy pin from ==11.0.2 (expired license) to >=13.0.0
- Use reformulate_sos="auto" in piecewise-linear-constraints notebook
  so it works with HiGHS
- Remove broken nbsphinx_execute_never (not supported in nbsphinx 0.9.4);
  use notebook metadata {"nbsphinx": {"execute": "never"}} instead for
  solve-on-oetc and solve-on-remote
- Set nbsphinx_allow_errors=False so real errors fail the RTD build
- Remove gurobipy uninstall workaround from CI workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Readers can now see why solve-on-oetc and solve-on-remote notebooks
have no cell outputs in the documentation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@FBumann FBumann requested a review from FabianHofmann March 13, 2026 11:31
@FBumann
Copy link
Collaborator Author

FBumann commented Mar 13, 2026

@FabianHofmann Should be a quick merge

Copy link
Collaborator

@FabianHofmann FabianHofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes! much safer, thanks!

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.

Add workflow for testing readthedocs notebooks

2 participants