Skip to content

Add Sphinx-Gallery caching and stabilize CI cache keys#23

Merged
bruAristimunha merged 1 commit intomainfrom
cache-CI
Mar 22, 2026
Merged

Add Sphinx-Gallery caching and stabilize CI cache keys#23
bruAristimunha merged 1 commit intomainfrom
cache-CI

Conversation

@bruAristimunha
Copy link
Copy Markdown
Contributor

@bruAristimunha bruAristimunha commented Mar 22, 2026

Summary

  • Add Sphinx-Gallery output caching in docs.yml keyed by hashFiles('examples/**/*.py'), so unchanged examples skip re-execution on subsequent builds
  • Stabilize data cache keys in both docs.yml and install-tests.yml by replacing github.run_id with a fixed v1 suffix — downloaded datasets (MNE, Nilearn) don't change between runs, so the run_id-based key was creating unnecessary cache entries

Context

Current docs build on main takes ~23 min. PR #21 adds a heavy example (plot_liebn_batch_normalization.py) that causes builds to hang for 6+ hours. This PR provides caching infrastructure so that once examples are built, they won't re-run unless the example scripts change.

Test plan

  • Verify docs CI completes successfully
  • On a second push with no example changes, verify gallery cache is restored (check "Restore Sphinx-Gallery Cache" step output)

- Add gallery output caching in docs.yml keyed by examples/**/*.py hash,
  so unchanged examples are not re-executed on subsequent builds
- Replace github.run_id with stable v1 suffix in data cache keys across
  both docs.yml and install-tests.yml to avoid unnecessary cache churn
  (downloaded datasets don't change between runs)
@github-actions
Copy link
Copy Markdown

📚 Documentation Preview

📦 Download Documentation Artifact

Download the documentation-html artifact from the workflow run to view the docs locally.

💡 To enable live previews, add a SURGE_TOKEN secret to this repository. See surge.sh for setup instructions.

@bruAristimunha bruAristimunha merged commit 4719156 into main Mar 22, 2026
11 checks passed
@bruAristimunha bruAristimunha deleted the cache-CI branch March 22, 2026 11:36
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.

1 participant