-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (42 loc) · 1.17 KB
/
docs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
name: Documentation Check
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
check-api-docs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x' # Specify your Python version
- name: Set up environment
uses: ./.github/actions/setup/poetry
with:
os: ${{ job.os }}
python-version: '3.11'
poetry-install-options: "--with=docs"
poetry-export-options: "--with=docs"
- name: Generate API docs
run: |
sphinx-apidoc -o /tmp/docs TusStorageHandler/
- name: Compare docs with main branch
id: check_docs_diff
run: |
shasum /tmp/docs/* > /tmp/docs.sha
shasum /docs/pages/* > /docs/project_doc.sha
diff=$(diff /tmp/docs.sha /docs/project_doc.sha) || true
if [[ -n "$diff" ]]; then
echo "::error::API documentation is out of date."
exit 1
else
echo "API documentation is up to date."
fi
...