Skip to content

Check Docs Manually #34

Check Docs Manually

Check Docs Manually #34

Workflow file for this run

name: Check Docs Manually
on:
workflow_dispatch:
inputs:
build_plugins:
description: 'Build API Docs with Plug-Ins'
required: true
default: true
type: boolean
build_examples:
description: 'Build API Docs with Examples'
required: true
default: true
type: boolean
jobs:
api:
name: Check API Documentation
runs-on: self-hosted
env:
gh_root: https://github.com/CEA-COSMIC/
tag_path: /archive/refs/tags/
gh_download: https://codeload.github.com/CEA-COSMIC/
develop_path: /tar.gz/refs/heads/develop
sphinx_opts: -t docs/_templates -feTMo docs/source
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10.12"
- name: Check Python Version
run: python --version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pandoc
python -m pip install git+https://github.com/cea-cosmic/modopt@develop # Workaround, to be removed
python -m pip install -r docs/requirements.txt
python -m pip install .
- name: Download plug-ins
if: ${{ inputs.build_plugins }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
plugin_version="$(echo ${_plugin} | awk -F== '{print $2}')"
wget ${gh_download}${plugin_name}${develop_path} -O ${plugin_name}.tar.gz
done < plugins.txt
for file in *.tar.gz; do
tar xzf "$file";
python -m pip install "$file"
done
rm *.tar.gz
- name: Extract plug-in examples
if: ${{ inputs.build_examples }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
cp -r ${plugin_name}-*/examples examples/${plugin_name} || echo "Warning: no examples found for ${plugin_name}"
done < plugins.txt
- name: Build PySAP source files
run: sphinx-apidoc ${sphinx_opts} pysap
- name: Build plug-in source files
if: ${{ inputs.build_plugins }}
run: |
while read _plugin; do
plugin_name="$(echo ${_plugin} | awk -F== '{print $1}')"
package_name="$(echo ${plugin_name} | awk -F- '{print $2}')"
sphinx-apidoc ${sphinx_opts} ${plugin_name}-*/${package_name}
done < plugins.txt
- name: Install GPU specific requirements
run: |
python -m pip install -r pysap-mri-*/gpu_requirements.txt
- name: Build API documentation
run: sphinx-build -E docs/source docs/_build
- name: Archive API build
uses: actions/upload-artifact@v2
with:
name: api-docs
retention-days: 14
path: docs/_build