Skip to content

Commit a29dd50

Browse files
wakame1367claude
andauthored
ci: test docs build on PRs (strict) and rename to docs.yml (#1463)
* docs(xarray): drop stray Returns section from conformance docstring The conformance endpoint had a docstring `Returns:` section but no return type annotation, which makes griffe emit a warning and fails `mkdocs build --strict`. Match the sibling `landing` endpoint (summary-only docstring, no annotation) so the strict docs build passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: test docs build on PRs and rename workflow to docs.yml Rename `deploy_mkdocs.yml` -> `docs.yml` and add a `test` job that runs `mkdocs build --strict` on pull requests, so broken docs are caught before they reach main. The existing deploy job is preserved and now gated behind `needs: test` (push to main only). Refs #1408 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7ab11b7 commit a29dd50

3 files changed

Lines changed: 90 additions & 49 deletions

File tree

‎.github/workflows/deploy_mkdocs.yml‎

Lines changed: 0 additions & 46 deletions
This file was deleted.

‎.github/workflows/docs.yml‎

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Publish docs via GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
# Only rebuild/deploy the website when docs have changed
9+
- 'README.md'
10+
- 'CHANGES.md'
11+
- 'CONTRIBUTING.md'
12+
- 'deployment/**'
13+
- 'docs/**'
14+
- '.github/workflows/docs.yml'
15+
pull_request:
16+
paths:
17+
# Test the docs build whenever something that feeds the docs changes.
18+
# The API reference and OpenAPI schema are generated from the source,
19+
# so source/dependency changes can break the strict build too.
20+
- 'README.md'
21+
- 'CHANGES.md'
22+
- 'CONTRIBUTING.md'
23+
- 'deployment/**'
24+
- 'docs/**'
25+
- 'src/titiler/**'
26+
- 'pyproject.toml'
27+
- 'uv.lock'
28+
- '.github/workflows/docs.yml'
29+
30+
permissions:
31+
contents: read
32+
33+
jobs:
34+
test:
35+
name: Test docs build
36+
runs-on: ubuntu-latest
37+
permissions:
38+
contents: read
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
42+
with:
43+
persist-credentials: false
44+
45+
- name: Install uv
46+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
47+
with:
48+
version: "0.9.*"
49+
enable-cache: false
50+
51+
- name: Generate OpenAPI schema
52+
run: |
53+
uv run python -c'from titiler.application.main import app; import json; print(json.dumps(app.openapi(), indent=4))' > docs/src/endpoints/openapi.json
54+
55+
- name: Build docs (strict)
56+
run: |
57+
uv run --group docs mkdocs build --strict -f docs/mkdocs.yml
58+
59+
deploy:
60+
name: Deploy docs
61+
needs: test
62+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
63+
runs-on: ubuntu-latest
64+
environment: github-pages
65+
permissions:
66+
contents: write # mkdocs gh-deploy pushes the built site to gh-pages
67+
steps:
68+
- name: Checkout main
69+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
70+
with:
71+
persist-credentials: false
72+
73+
- name: Install uv
74+
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
75+
with:
76+
version: "0.9.*"
77+
enable-cache: false
78+
79+
- name: Generate OpenAPI schema
80+
run: |
81+
uv run python -c'from titiler.application.main import app; import json; print(json.dumps(app.openapi(), indent=4))' > docs/src/endpoints/openapi.json
82+
83+
- name: Deploy docs
84+
run: |
85+
git config user.name "github-actions[bot]"
86+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
87+
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
88+
uv run --group docs mkdocs gh-deploy --force -f docs/mkdocs.yml
89+
env:
90+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎src/titiler/xarray/titiler/xarray/main.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,6 @@ def conformance(
432432
433433
Called with `GET /conformance`.
434434
435-
Returns:
436-
Conformance classes which the server conforms to.
437-
438435
"""
439436
data = {"conformsTo": sorted(TITILER_CONFORMS_TO)}
440437

0 commit comments

Comments
 (0)