Skip to content

Commit 96ef0f4

Browse files
committed
ci(docs): fix stale cache key and add PR build artifact
The doc build cache key only hashed examples/**/*.py, doc/**/*, and conf.py. A change to library code under eegnb/ (e.g. #330) still counts as a 'full build' per the earlier changed-files check, but the cache step restores the same doc/_build/html as before since its key is unchanged, and sphinx-gallery skips re-running any example script that itself is unchanged. Net effect: CI can report success without ever re-rendering the affected example. Also there was no way to see a PR's doc build without checking it out and building locally - docs.yml only publishes to GitHub Pages on push to master. Upload the built HTML as a workflow artifact on every run so reviewers can download and open it directly from the PR's checks tab.
1 parent 152e40a commit 96ef0f4

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/docs.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,26 @@ jobs:
5151
with:
5252
path: |
5353
doc/_build/html
54-
key: ${{ runner.os }}-sphinx-${{ hashFiles('examples/**/*.py', 'doc/**/*', 'conf.py') }}
54+
# Includes eegnb/**/*.py so a change to library code (not just an
55+
# example or doc file) invalidates the cache too - otherwise the
56+
# "full build" this triggers (see Determine build mode above) still
57+
# restores a stale doc/_build/html, and sphinx-gallery skips
58+
# re-running any example whose own script file is unchanged, so the
59+
# rendered output never actually reflects the library change.
60+
key: ${{ runner.os }}-sphinx-${{ hashFiles('examples/**/*.py', 'doc/**/*', 'conf.py', 'eegnb/**/*.py') }}
5561
restore-keys: |
5662
${{ runner.os }}-sphinx-
5763
5864
- name: Build docs
5965
run: make docs
6066

67+
- name: Upload built docs
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: docs-build-preview
71+
path: doc/_build/html
72+
retention-days: 14
73+
6174
- name: Deploy Docs
6275
uses: peaceiris/actions-gh-pages@v3
6376
if: github.ref == 'refs/heads/master' # TODO: Deploy seperate develop-version of docs?

0 commit comments

Comments
 (0)