Skip to content

Commit cb6ab64

Browse files
igerberclaude
andcommitted
docs: enforce Sphinx -W in CI + add T21 to toctree (Sphinx PR 3)
Adds a sphinx-build job to .github/workflows/docs-tests.yml that runs make -C docs html SPHINXOPTS="-W" so warnings become build failures. This locks in the 0-warning state PR #410 achieved and blocks any future warning from sneaking in. The job mirrors the RTD build (.readthedocs.yaml): Python 3.11, pandoc apt package for nbsphinx, and the same docs extras pinned in pyproject.toml [project.optional-dependencies.docs]. Also adds tutorials/21_had_pretest_workflow to the Tutorials: Business Applications toctree at docs/index.rst:84. PR #409 landed this notebook without a toctree entry; -W enforcement caught it on the local smoke test before push. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 05c2cb4 commit cb6ab64

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/docs-tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,36 @@ jobs:
6060
# source without invoking the maturin/Rust build (mirrors Pure
6161
# Python Fallback at rust-test.yml:189-193).
6262
run: PYTHONPATH=. DIFF_DIFF_BACKEND=python pytest tests/test_doc_snippets.py -v
63+
64+
sphinx-build:
65+
name: Sphinx HTML build (-W warnings as errors)
66+
if: >-
67+
github.event_name != 'pull_request'
68+
|| contains(github.event.pull_request.labels.*.name, 'ready-for-ci')
69+
runs-on: ubuntu-latest
70+
71+
steps:
72+
- uses: actions/checkout@v6
73+
74+
- name: Install pandoc
75+
# nbsphinx invokes pandoc to render notebook markdown cells.
76+
run: sudo apt-get update && sudo apt-get install -y pandoc
77+
78+
- name: Set up Python
79+
uses: actions/setup-python@v6
80+
with:
81+
# Match the RTD build (.readthedocs.yaml:9) so CI catches drift
82+
# against what users actually see on diff-diff.readthedocs.io.
83+
python-version: '3.11'
84+
85+
- name: Install docs dependencies
86+
# Keep in sync with pyproject.toml [project.optional-dependencies.docs]
87+
# and .readthedocs.yaml post_install. Skips the maturin/Rust build:
88+
# docs/conf.py imports diff_diff via sys.path from checked-out source.
89+
run: pip install "numpy>=1.20.0" "pandas>=1.3.0" "scipy>=1.7.0" "sphinx>=6.0" "pydata-sphinx-theme>=0.15" "sphinxext-opengraph>=0.9" "sphinx-sitemap>=2.5" "nbsphinx>=0.9" "matplotlib>=3.5"
90+
91+
- name: Build docs with warnings as errors
92+
# SPHINXOPTS="-W" turns every Sphinx warning into a build failure.
93+
# PR #410 brought make html to 0 warnings; -W keeps it that way by
94+
# blocking any new warning from sneaking in.
95+
run: make -C docs html SPHINXOPTS="-W"

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Quick Links
8181
tutorials/18_geo_experiments
8282
tutorials/19_dcdh_marketing_pulse
8383
tutorials/20_had_brand_campaign
84+
tutorials/21_had_pretest_workflow
8485

8586
.. toctree::
8687
:maxdepth: 1

0 commit comments

Comments
 (0)