fix: ci #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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 environment | |
uses: ./.github/actions/setup/poetry | |
with: | |
os: ${{ job.os }} | |
python-version: '3.11' | |
poetry-install-options: "--with=docs --with=types --no-root" | |
poetry-export-options: "--with=docs --with=types" | |
- name: Generate API docs | |
run: | | |
poetry run sphinx-apidoc -o /tmp/docs tus_storagehandler/ | |
- name: Compare docs with main branch | |
id: check_docs_diff | |
run: | | |
shasum /tmp/docs/* > /tmp/docs.sha | |
shasum tus_storagehandler/docs/pages/* > tus_storagehandler/docs/project_doc.sha | |
diff=$(diff /tmp/docs.sha tus_storagehandler/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 | |
... |