Skip to content

feat: reusable workflows #6

feat: reusable workflows

feat: reusable workflows #6

Workflow file for this run

name: check docs
on: pull_request
jobs:
mkdocs:
runs-on: ubuntu-latest
environment: mkdocs
steps:
- uses: actions/checkout@v4
- name: Run mkdocs
run: |
pip3 install uv
uv venv
source .venv/bin/activate
uv pip install -r deps/x86_64-unknown-linux-gnu/requirements_docs.txt
set +e # Do not exit shell on failure
out=$(mkdocs build 2> stderr.txt)
exit_code=$?
err=$(<stderr.txt)
# Display the raw output in the step
echo "${out}"
echo "${err}"
# Display the Markdown output in the job summary
{ echo "\`\`\`python"; echo "${out}"; echo "${err}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
if [[ "${exit_code}" -ne 0 ]]; then
# If the build failed, try to generate the __init__.py file and build again
python scripts/gen_init_py.py
out=$(mkdocs build 2> stderr.txt)
new_exit_code=$?
if [[ "${new_exit_code}" -eq 0 ]]; then
echo "Tip: the build succeeded after generating __init__.py. Try running scripts/gen_init_py.py." >> "$GITHUB_STEP_SUMMARY"
fi
fi
exit ${exit_code}