ci: add job to generate docs (MR 2266)

This commit is contained in:
Robert Eckelmann 2024-05-08 14:39:58 -07:00 committed by Newbyte
parent 974b76c00a
commit d28174bf95
No known key found for this signature in database
GPG Key ID: 8A700086A9FE41FD
3 changed files with 37 additions and 0 deletions

26
.ci/docs.sh Executable file
View File

@ -0,0 +1,26 @@
#!/bin/sh -e
# Description: create documentation with sphinx
# Options: native
# https://postmarketos.org/pmb-ci
# Ensure sphinx_rtd_theme is installed
if [ "$(id -u)" = 0 ]; then
set -x
apk -q add \
py3-sphinx_rtd_theme \
py3-sphinxcontrib-autoprogram
exec su "${TESTUSER:-build}" -c "sh -e $0"
fi
# Require sphinx to be installed on the host system
if [ -z "$(command -v sphinx-build)" ]; then
echo "ERROR: sphinx-build command not found, make sure it is in your PATH."
exit 1
fi
sphinx-build \
docs \
public \
# -E -a -v -T

1
.gitignore vendored
View File

@ -19,6 +19,7 @@ __pycache__/
# Distribution / packaging
.Python
public/
env/
develop-eggs/
dist/

View File

@ -8,6 +8,7 @@ workflow:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_COMMIT_BRANCH == 'wip'
- if: $CI_COMMIT_BRANCH == 'docs'
before_script: &global_before_scripts
- ".ci/note.sh"
@ -62,3 +63,12 @@ mypy:
stage: lint
script:
- ".ci/mypy.sh"
docs:
stage: lint
script:
- apk add py3-sphinx py3-sphinx_rtd_theme
- ".ci/docs.sh"
artifacts:
paths:
- public