Skip to content

Speed up documentation builds done via GitHub Actions in CI by caching previous build #2258

Open

Description

@namurphy

Right now our documentation builds currently take ∼10–15 minutes. A consequence of this is that we often have to push a minor change to a reStructuredText file to try to resolve a warning in the documentation, and then wait ∼10—15 minutes to see if it goes through.

It would be really helpful if we could speed up the documentation build in CI. One possibility would be to have a GitHub Action that would cache the output of the previous documentation build, and then rebuild the documentation from that. Doing this would allow Sphinx to only regenerate the documentation pages that correspond to files that have changed, which should greatly speed things up.

There are a few things we would need to be careful about. For example, there will be occasions where we would want to do a fresh rebuild of everything, like possibly when we edit configuration stuff in docs/conf.py and want to make sure that everything gets updated. For that, we could potentially create a label that would make Sphinx rebuild the docs from scratch, or manually remove the cached build. It's also possible that errors could be hidden by rebuilding the docs from scratch. The RTD build should be able to take care of that, in particular if we require that the RTD build doesn't have any warnings.

Activity

  1. added
    priority: mediumIssues & PRs of moderate urgency and importance
    Plasma Lv0 | NoviceIssues that do not require knowledge of physics
    GitHub ActionsA continuous integration platform for automating tests and other tasks (see .github/ directory)
    on Jan 18, 2024
  2. namurphy commented on Mar 1, 2024

    @namurphy
    MemberAuthor

    I wasn't able to handle this in #2552 because I started getting some documentation build errors which I had a hard time understanding when I cached the doc build.

    When implementing this, it would be really helpful to put the pull request number in the cache key so that every pull request has a different doc build cache.

    It'd also be helpful to put both requirements.txt and docs/conf.py in hashFiles so that when either of those files change, the docs get rebuilt from scratch. There might be some other files we'd want to include in there too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GitHub ActionsA continuous integration platform for automating tests and other tasks (see .github/ directory)Plasma Lv0 | NoviceIssues that do not require knowledge of physicsPython Lv3 | ProficientIssues that require proficiency in Pythondocumentation infrastructurepriority: mediumIssues & PRs of moderate urgency and importance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions