Skip to content

Commit

Permalink
Another attempt
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Dec 20, 2023
1 parent 1856eb4 commit 0d99d8e
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 67 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Print info
run: echo ${{ github.event.push.ref }}

- uses: actions/checkout@v4
- uses: actions/configure-pages@v4
- uses: cvmfs-contrib/github-action-cvmfs@v3
Expand All @@ -28,15 +25,15 @@ jobs:
python3 -m pip install -r doc/requirements.txt
export PATH=/root/.local/bin:$PATH
echo -e "::endgroup::\n::group::Build podio"
cmake -B build . --install-prefix=$(pwd)/install \
-GNinja -DENABLE_SIO=ON -DENABLE_RNTUPLE=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_CXX_STANDARD=17
cmake --build build --target install
export PYTHONPATH=$(pwd)/install/python:$PYTHONPATH
export LD_LIBRARY_PATH=$(pwd)/install/lib*/:$LD_LIBRARY_PATH
export ROOT_INCLUDE_PATH=$(pwd)/install/include
# echo -e "::endgroup::\n::group::Build podio"
# cmake -B build . --install-prefix=$(pwd)/install \
# -GNinja -DENABLE_SIO=ON -DENABLE_RNTUPLE=ON \
# -DBUILD_TESTING=OFF \
# -DCMAKE_CXX_STANDARD=17
# cmake --build build --target install
# export PYTHONPATH=$(pwd)/install/python:$PYTHONPATH
# export LD_LIBRARY_PATH=$(pwd)/install/lib*/:$LD_LIBRARY_PATH
# export ROOT_INCLUDE_PATH=$(pwd)/install/include
echo -e "::endgroup::\n::group::build doc"
sphinx-build -M html doc doc_output
Expand All @@ -50,18 +47,22 @@ jobs:
needs: build-doc
runs-on: ubuntu-latest

if: endsWith(github.event.push.ref, '/doc-on-gh-pages')

steps:
- uses: actions/checkout@v4
with:
ref: gh-pages
- uses: actions/download-artifact@v4
with:
name: github-pages
path: master
- name: Unpack artifact
path: doc_artifact

- name: Update documentation
run: |
tar -xvf master/artifact.tar
rm master/artifact.tar
rm -rf master
tar -xvf doc_artifact/artifact.tar --directory master
rm -r doc_artifact
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
102 changes: 51 additions & 51 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,54 +100,54 @@

# -- Automatic API documentation (c++) ----------------------------------------

print(f"Executing doxygen in {doc_dir}")
doxygen_version = subprocess.check_output(["doxygen", "--version"], encoding="utf-8")
print(f"Doxygen version: {doxygen_version}")

env = os.environ.copy()
env["DOXYGEN_WARN_AS_ERROR"] = "NO"

os.makedirs("_build/cpp", exist_ok=True)

subprocess.check_call(
["doxygen", "Doxyfile"], stdout=subprocess.PIPE, cwd=doc_dir, env=env
)

cpp_api_index_target = doc_dir / "cpp_api/api.rst"

print(f"Executing breath apidoc in {doc_dir}")
subprocess.check_call(
[sys.executable, "-m", "breathe.apidoc", "_build/cpp/doxygen-xml", "-o", "cpp_api"],
stdout=subprocess.PIPE,
cwd=doc_dir,
env=env,
)

if not cpp_api_index_target.exists():
shutil.copyfile(doc_dir / "cpp_api.rst", cpp_api_index_target)

print("Done with c++ API doc generation")

# -- Automatic API documentation (python) --------------------------------------

# Make sure that the __init__ docstrings appear as part of the class
# documentation
autoclass_content = "both"

print("Executing sphinx-apidoc for python API")
print(f"Executing sphinx-apidoc in {doc_dir}")
subprocess.check_call(
[
sys.executable,
"-m",
"sphinx.ext.apidoc",
"--force",
"-o",
"py_api",
"../python",
"../*/*test_*.py", # exclude tests
"../python/podio_version.py",
]
)

print("Done with python API doc generation")
# print(f"Executing doxygen in {doc_dir}")
# doxygen_version = subprocess.check_output(["doxygen", "--version"], encoding="utf-8")
# print(f"Doxygen version: {doxygen_version}")

# env = os.environ.copy()
# env["DOXYGEN_WARN_AS_ERROR"] = "NO"

# os.makedirs("_build/cpp", exist_ok=True)

# subprocess.check_call(
# ["doxygen", "Doxyfile"], stdout=subprocess.PIPE, cwd=doc_dir, env=env
# )

# cpp_api_index_target = doc_dir / "cpp_api/api.rst"

# print(f"Executing breath apidoc in {doc_dir}")
# subprocess.check_call(
# [sys.executable, "-m", "breathe.apidoc", "_build/cpp/doxygen-xml", "-o", "cpp_api"],
# stdout=subprocess.PIPE,
# cwd=doc_dir,
# env=env,
# )

# if not cpp_api_index_target.exists():
# shutil.copyfile(doc_dir / "cpp_api.rst", cpp_api_index_target)

# print("Done with c++ API doc generation")

# # -- Automatic API documentation (python) --------------------------------------

# # Make sure that the __init__ docstrings appear as part of the class
# # documentation
# autoclass_content = "both"

# print("Executing sphinx-apidoc for python API")
# print(f"Executing sphinx-apidoc in {doc_dir}")
# subprocess.check_call(
# [
# sys.executable,
# "-m",
# "sphinx.ext.apidoc",
# "--force",
# "-o",
# "py_api",
# "../python",
# "../*/*test_*.py", # exclude tests
# "../python/podio_version.py",
# ]
# )

# print("Done with python API doc generation")

0 comments on commit 0d99d8e

Please sign in to comment.