Skip to content

Add a docs-build CI job#3252

Merged
brendancol merged 4 commits into
mainfrom
issue-3249-pr2
Jun 12, 2026
Merged

Add a docs-build CI job#3252
brendancol merged 4 commits into
mainfrom
issue-3249-pr2

Conversation

@brendancol

@brendancol brendancol commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Refs #3249 (part 2 of 6).

Sphinx currently only runs on Read the Docs, so a PR that breaks the docs build isn't caught until after merge. This adds a docs workflow that runs on PRs touching docs/**, README.md, setup.cfg, or .readthedocs.yml:

  • installs .[doc,tests] on Python 3.12, mirroring the RTD pre_build step so the two can't drift
  • installs the pandoc binary via apt (nbsphinx needs it; the pandoc pip package doesn't ship it)
  • sphinx-build -b html -j auto, gating on errors only (no -W; the tree has a handful of pre-existing notebook/reference warnings). The read phase is dominated by plot-directive examples in the reference docstrings (sample data load + numba compile per page); every extension in conf.py declares parallel_read_safe, so -j auto cuts the build from ~8 minutes to ~3.5.
  • linkcheck runs on a weekly cron (Mondays 06:00 UTC) and workflow_dispatch instead of per PR. It cost ~10 minutes per PR, never gated (continue-on-error), and was in fact already exiting 1 with nobody noticing. The cron job drops continue-on-error so a broken link actually fails the run. Expect the first scheduled run to be red: there are real broken links to fix.

The job id is docs-build, distinct from the pytest workflow's run job, to avoid the check-name dedup problem that hides failures.

Test plan:

  • YAML parses
  • docs-build passes on this PR in 4m51s (was 18m48s)
  • linkcheck is skipped on pull_request events

@github-actions github-actions Bot added the performance PR touches performance-sensitive code label Jun 12, 2026

@brendancol brendancol left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PR Review: Add a docs-build CI job

Blockers

None.

Suggestions

  • .github/workflows/docs.yml: the job has no timeout-minutes. continue-on-error: true keeps a linkcheck failure from gating, but a hung external link check still occupies the runner until the default 6-hour job timeout. A cap around 30 minutes covers a full build (RTD finishes in well under that) and bounds the damage.

Nits

None.

What looks good

  • Action versions match test.yml (checkout@v4, setup-python@v5), and the install step mirrors .readthedocs.yml's pip install '.[doc,tests]' exactly, so CI and RTD build from the same dependency set.
  • The paths filter includes the workflow file itself, which is why this check ran on this very PR.
  • Job id docs-build avoids the duplicate-check-name dedup problem already seen between the pytest workflows.
  • apt pandoc install is needed: the pandoc pip package in the doc extra does not provide the binary.

Checklist

  • Correctness/backend/test items: not applicable (CI config only)
  • Verified the workflow triggers and the YAML parses

@brendancol brendancol left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Follow-up to the review: added timeout-minutes: 30 to the docs-build job so a stalled linkcheck can't hold a runner for the default 6-hour timeout. No other findings to address.

@brendancol

Copy link
Copy Markdown
Contributor Author

Measured the first two runs: ~26-27 minutes each (HTML build ~11, linkcheck ~14), which left under 3 minutes of headroom against the 30-minute cap. Raised it to 45.

…ly cron (#3249)

The PR job spent ~10 of its 18 minutes on linkcheck, whose failures
were masked by continue-on-error, and ~8 on a serial HTML build whose
read phase is dominated by plot-directive examples (sample data load
plus numba compile per reference page).

- build with -j auto; every extension in conf.py declares
  parallel_read_safe
- run linkcheck on a weekly cron and workflow_dispatch instead of on
  PRs, without continue-on-error so broken links surface
- drop the job timeout from 45 to 15 minutes to match
@brendancol brendancol merged commit 7938cfd into main Jun 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance PR touches performance-sensitive code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant