tulip-control / tulip-control

Temporal Logic Planning toolbox
http://tulip-control.org
BSD 3-Clause "New" or "Revised" License
109 stars 35 forks source link

CI: compare commit hash to decide if docs changed #259

Closed slivingston closed 4 months ago

slivingston commented 4 months ago

During review of https://github.com/tulip-control/tulip-control/pull/256, I missed that make html was removed in https://github.com/tulip-control/tulip-control/commit/14417c5f34df4b238aec707c5e1ca9e26b532043 while the newly added contrib/ci_deploy_doc.py is not called. As such, documentation CI jobs on main branch are now failing.

As noted in the comments of ci_deploy_doc.py, the timestamp added to files will cause diff between previous and new docs files to always be nonempty. In this pull request, I propose to decide whether new docs should be posted according to whether the most recent commit hash involving the doc/ directory has changed. The only limitation of this approach is to not detect changes that are included in the documentation from outside the doc/ directory, e.g., via autoclass and autofunction blocks in doc/tutorial.rst.

Therefore, I propose we do one of the following:

  1. merge this PR,
  2. extend this PR to also check whether the tulip directory has changed,
  3. modify this PR to only add make html, such that docs pushes happen on every merge to main branch.

In all cases, note that the branch docs_pages for GitHub Pages is special, and we can delete it and create a new one as desired to avoid excess blob creation, deploy docs manually, etc.

slivingston commented 4 months ago

This is the final issue before I will make a release.

slivingston commented 4 months ago

@johnyf Thanks for reviewing! I reverted the removal of gitpython (i.e., main.yml installs gitpython as it did before this pull request), and I added the examples and tulip directories to the commit hash comparison.