Skip to content

Commit aa7c381

Browse files
committed
adding ci build for docuemntation
1 parent 19aa1f8 commit aa7c381

File tree

4 files changed

+67
-8
lines changed

4 files changed

+67
-8
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: HTTomo-backends docs
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- main
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
build-docs-publish:
14+
runs-on: ubuntu-latest
15+
defaults:
16+
run:
17+
shell: bash -el {0}
18+
steps:
19+
- name: Checkout repository code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Python 3.10
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: '3.10'
26+
27+
- name: httomo-backends-docs
28+
uses: conda-incubator/setup-miniconda@v2
29+
with:
30+
auto-update-conda: false
31+
activate-environment: httomo-backends-docs
32+
environment-file: ./docs/source/doc-conda-requirements.yml
33+
34+
- name: Build api docs
35+
run: sphinx-apidoc -feT -t=./docs/source/_templates -o ./docs/source/api ./httomo_backends
36+
37+
- name: Generate yaml templates
38+
run: |
39+
$CONDA/bin/conda activate httomo-backends-docs
40+
pip install httomolib
41+
pip install httomolibgpu --no-deps
42+
43+
- name: Generate yaml templates
44+
run: |
45+
python ./httomo_backends/scripts/yaml_templates_generator.py -i ./httomo_backends/methods_database/backends/tomopy/tomopy_modules.yaml -o ./docs/build/yaml_templates/tomopy
46+
python ./httomo_backends/scripts/yaml_unsupported_tomopy_remove.py -t ./docs/build/yaml_templates/tomopy -l ./httomo_backends/methods_database/backends/tomopy/tomopy.yaml
47+
python ./httomo_backends/scripts/yaml_templates_generator.py -i ./httomo_backends/methods_database/backends/httomolib/httomolib_modules.yaml -o ./docs/build/yaml_templates/httomolib
48+
python ./httomo_backends/scripts/yaml_templates_generator.py -i ./httomo_backends/methods_database/backends/httomolibgpu/httomolibgpu_modules.yaml -o ./docs/build/yaml_templates/httomolibgpu
49+
50+
- name: Generate yml docs
51+
run: python ./docs/source/yaml_doc_generator.py
52+
53+
- name: Build html
54+
run: sphinx-build -a -E -b html ./docs/source/ ./docs/build/
55+
56+
- name: Publish docs
57+
if: github.ref_type == 'tag' || github.ref_name == 'main'
58+
run: ghp-import -n -p -f ./docs/build
59+
env:
60+
GITHUB_TOKEN: ${{ github.token }}

.github/workflows/httomo_backends_pypi_publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ jobs:
2525
$CONDA/bin/conda install conda-forge::pyyaml
2626
$CONDA/bin/pip install setuptools wheel
2727
$CONDA/bin/pip install build
28-
$CONDA/bin/pip install httomolib==2.1
29-
$CONDA/bin/pip install --no-deps httomolibgpu==2.1.1
28+
$CONDA/bin/pip install httomolib
29+
$CONDA/bin/pip install --no-deps httomolibgpu
3030
$CONDA/bin/conda list
3131
- name: Generate yaml templates
3232
run: |

docs/source/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@
9292
html_title = "httomo-backends documentation page"
9393
html_copy_source = True
9494
html_last_updated_fmt = ""
95-
html_static_path = ["_static"]
9695
html_use_smartypants = True
9796

9897
html_theme_options = {

docs/sphinx-build.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ rm -rf $DIR/build/
2525
# add -Q to suppress warnings
2626

2727
# sphinx-apidoc generates source files that use sphinx.ext.autodoc to document all found modules
28-
sphinx-apidoc -feT -t=$DIR/source/_templates -o $DIR/source/api $DIR/../httomo
28+
sphinx-apidoc -feT -t=$DIR/source/_templates -o $DIR/source/api $DIR/../httomo_backends
2929

3030
# build yaml templates here:
31-
python $DIR/../scripts/yaml_templates_generator.py -i $DIR/../httomo/methods_database/packages/external/tomopy/tomopy_modules.yaml -o $DIR/build/yaml_templates/tomopy
32-
python $DIR/../scripts/yaml_unsupported_tomopy_remove.py -t $DIR/build/yaml_templates/tomopy -l $DIR/../httomo/methods_database/packages/external/tomopy/tomopy.yaml
33-
python $DIR/../scripts/yaml_templates_generator.py -i $DIR/../httomo/methods_database/packages/external/httomolibgpu/httomolibgpu_modules.yaml -o $DIR/build/yaml_templates/httomolibgpu
34-
python $DIR/../scripts/yaml_templates_generator.py -i $DIR/../httomo/methods_database/packages/external/httomolib/httomolib_modules.yaml -o $DIR/build/yaml_templates/httomolib
31+
python $DIR/../httomo_backends/scripts/yaml_templates_generator.py -i $DIR/../httomo_backends/methods_database/backends/tomopy/tomopy_modules.yaml -o $DIR/build/yaml_templates/tomopy
32+
python $DIR/../httomo_backends/scripts/yaml_unsupported_tomopy_remove.py -t $DIR/build/yaml_templates/tomopy -l $DIR/../httomo_backends/methods_database/backends/tomopy/tomopy.yaml
33+
python $DIR/../httomo_backends/scripts/yaml_templates_generator.py -i $DIR/../httomo_backends/methods_database/backends/httomolibgpu/httomolibgpu_modules.yaml -o $DIR/build/yaml_templates/httomolibgpu
34+
python $DIR/../httomo_backends/scripts/yaml_templates_generator.py -i $DIR/../httomo_backends/methods_database/backends/httomolib/httomolib_modules.yaml -o $DIR/build/yaml_templates/httomolib
3535

3636
# Append yaml link to rst files
3737
python -m source.yaml_doc_generator

0 commit comments

Comments
 (0)