|
5 | 5 | # before publishing — skip here to avoid running the suite twice. |
6 | 6 | tags-ignore: |
7 | 7 | - '**' |
| 8 | + # `docs/**` is intentionally NOT ignored: docs-only commits still need |
| 9 | + # to validate via the strict Sphinx build (the `docs` job below). |
8 | 10 | paths-ignore: |
9 | | - - 'docs/**' |
10 | 11 | - 'README.md' |
11 | 12 | - 'CLAUDE.md' |
12 | 13 | - '.github/workflows/docs_pages.yaml' |
13 | 14 | pull_request: |
14 | 15 | paths-ignore: |
15 | | - - 'docs/**' |
16 | 16 | - 'README.md' |
17 | 17 | - 'CLAUDE.md' |
18 | 18 | - '.github/workflows/docs_pages.yaml' |
@@ -67,11 +67,47 @@ jobs: |
67 | 67 | if-no-files-found: warn |
68 | 68 | retention-days: 7 |
69 | 69 |
|
| 70 | + # Strict Sphinx build acts as a docstring/signature drift gate. Runs in |
| 71 | + # parallel with pytest; publish-test depends on both. Same `-W` flag the |
| 72 | + # Pages deploy uses (docs_pages.yaml), so any failure here would also |
| 73 | + # break the production deploy on main. The built site is uploaded as a |
| 74 | + # workflow artifact so dev-branch docs changes can be previewed without |
| 75 | + # deploying to GitHub Pages (which only happens from main). |
| 76 | + docs: |
| 77 | + runs-on: ubuntu-latest |
| 78 | + permissions: |
| 79 | + contents: read |
| 80 | + steps: |
| 81 | + - name: Checkout |
| 82 | + uses: actions/checkout@v5 |
| 83 | + |
| 84 | + - name: Install uv |
| 85 | + uses: astral-sh/setup-uv@v6 |
| 86 | + |
| 87 | + - name: Install Python 3.13 |
| 88 | + run: uv python install 3.13 |
| 89 | + |
| 90 | + - name: Install dependencies |
| 91 | + run: uv sync --all-extras |
| 92 | + |
| 93 | + - name: Build Sphinx + Furo site (strict) |
| 94 | + run: uv run sphinx-build -W --keep-going -b html docs/source docs/build/sphinx |
| 95 | + |
| 96 | + - name: Upload built docs as artifact |
| 97 | + if: always() |
| 98 | + uses: actions/upload-artifact@v4 |
| 99 | + with: |
| 100 | + name: docs-html |
| 101 | + path: docs/build/sphinx |
| 102 | + if-no-files-found: warn |
| 103 | + retention-days: 14 |
| 104 | + |
70 | 105 | # Publish a `.devN` pre-release wheel to TestPyPI on every push to dev, |
71 | | - # gated on the full pytest matrix passing. Lives in this workflow (rather |
72 | | - # than a separate `workflow_run`-triggered file) so that the gate is a |
73 | | - # plain `needs:` dependency — `workflow_run` only fires from workflows |
74 | | - # that exist on the default branch, which is a maintenance footgun. |
| 106 | + # gated on BOTH the full pytest matrix and the strict docs build passing. |
| 107 | + # Lives in this workflow (rather than a separate `workflow_run`-triggered |
| 108 | + # file) so that the gate is a plain `needs:` dependency — `workflow_run` |
| 109 | + # only fires from workflows that exist on the default branch, which is a |
| 110 | + # maintenance footgun. |
75 | 111 | # |
76 | 112 | # One-time setup required at https://test.pypi.org/manage/account/publishing/ |
77 | 113 | # Owner: Botts-Innovative-Research |
|
80 | 116 | # Environment: publish-test |
81 | 117 | # And in this repo's Settings -> Environments, create env `publish-test`. |
82 | 118 | publish-test: |
83 | | - needs: pytest |
| 119 | + needs: [pytest, docs] |
84 | 120 | if: github.event_name == 'push' && github.ref == 'refs/heads/dev' |
85 | 121 | runs-on: ubuntu-latest |
86 | 122 | environment: |
|
0 commit comments