Skip to content

Commit 12c494d

Browse files
committed
Add pull request job for validating the documentation build
This allows the documentation build to be previewed. This may be something that a developer making active changes to the documentation would want to double check. This does _not_ actually publish the documentation pages anywhere, but they will be available for download on the pull request action itself. There was a recent version bump that I believe would have broken the documentation build (see: #4503). So this is also designed to test any dependency updates made to our docs.
1 parent 089a00a commit 12c494d

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

.github/workflows/pull_request.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
# entirely if the `plan` job determined none of these subprojects are affected.
2727
# 5. coverage: Merges the JaCoCo output of 3 and 4 and generates reports. Tolerates 3 and/or 4
2828
# having been skipped or having skipped some matrix legs.
29+
# 6. docs: Builds the documentation site and uploads it as a zipped artifact so reviewers can
30+
# download and preview it. This does NOT publish the site anywhere (that only happens during
31+
# a release).
2932

3033
style:
3134
runs-on: ubuntu-latest
@@ -281,3 +284,36 @@ jobs:
281284
python3 build/coverage_annotations.py \
282285
--report .out/reports/jacoco/codeCoverageReport/codeCoverageReport.xml \
283286
--diff pr_diff.patch
287+
288+
docs:
289+
runs-on: ubuntu-latest
290+
permissions:
291+
contents: read
292+
timeout-minutes: 30
293+
steps:
294+
- name: Checkout sources
295+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
296+
- name: Setup Base Environment
297+
id: setup-base
298+
uses: ./actions/setup-base-env
299+
- name: Cache Python Environment
300+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
301+
with:
302+
path: docs/sphinx/.venv
303+
key: ${{ runner.os }}-sphinx-python-${{ steps.setup-base.outputs.python-version }}-${{ hashFiles('docs/sphinx/requirements.txt') }}
304+
- name: Build Documentation Site
305+
uses: ./actions/run-gradle
306+
with:
307+
gradle_command: documentationSite -PreleaseBuild=false
308+
- name: Zip Documentation Site
309+
shell: bash
310+
run: |
311+
cd docs/sphinx/.out/html
312+
zip -r "${{ github.workspace }}/documentation-site.zip" .
313+
# Upload to the build's artifacts only. Note: does not use upload-pages-artifact or deploy-docs here
314+
- name: Upload Documentation
315+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
316+
with:
317+
name: documentation-site
318+
path: documentation-site.zip
319+
retention-days: 7

0 commit comments

Comments
 (0)